/* ---------- Tripgain Hotel Mapping -- Admin console ---------- */

:root {
  --primary-color: #f26e22;
  --primary-600: #d85e16;
  --secondary-color: #0d385f;
  --secondary-700: #0a2c4a;
  --primary-soft: rgba(242, 110, 34, .10);
  --secondary-soft: rgba(13, 56, 95, .06);
  --bg: #f4f6f9;
  --panel: #ffffff;
  --border: #e3e7ee;
  --text: #16223a;
  --text-dim: #677085;
  --green: #1f9d55;
  --red: #d4351c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 28px rgba(13, 56, 95, .07);
  --shadow-sm: 0 2px 8px rgba(13, 56, 95, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 8px rgba(13, 56, 95, .06);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}
.topbar .logo { height: 38px; display: block; }
.topbar .title {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: .2px;
  color: var(--secondary-color);
  padding-left: 10px;
  border-left: 1px solid var(--border);
  line-height: 24px;
}
.topbar .admin-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-color);
  background: var(--primary-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
.topbar .spacer { flex: 1; }
.topbar .nav-link {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.topbar .nav-link:hover {
  background: var(--secondary-soft);
  color: var(--secondary-color);
}
.topbar .nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary-color);
}
.topbar button.logout-btn {
  background: #fff;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all .15s ease;
}
.topbar button.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(212, 53, 28, .06);
}

/* ---------- Layout ---------- */
.shell {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  padding: 24px;
  align-items: start;
  max-width: 1320px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.panel-head .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--secondary-soft);
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel-head .icon svg { width: 15px; height: 15px; }
.panel h2 {
  margin: 0;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--secondary-color);
  font-weight: 700;
}
.panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  font-weight: 700;
  margin: 24px 0 12px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
tr.row-item { transition: background .12s ease; border-left: 3px solid transparent; }
tr.row-item:hover { cursor: pointer; background: var(--secondary-soft); }
tr.row-item.selected { background: var(--primary-soft); border-left-color: var(--primary-color); }
tr.row-item.selected td:first-child { font-weight: 700; color: var(--secondary-color); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-600));
  color: #fff;
  box-shadow: 0 4px 12px rgba(242, 110, 34, .28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(242, 110, 34, .36); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--secondary-color); color: var(--secondary-color); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(212, 53, 28, .32); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:active:not(:disabled) { transform: scale(.96); }

/* Instant feedback on any button that's waiting on a network call -- a
   spinner appears immediately on click so a slow request never looks like
   the click did nothing. */
.btn.is-loading {
  opacity: .8 !important;
  pointer-events: none;
  position: relative;
  padding-right: 32px;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 13px;
  height: 13px;
  margin-top: -6.5px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: shared-spin .6s linear infinite;
}
.btn-outline.is-loading::after, .btn-danger.is-loading::after {
  border-color: var(--border);
  border-top-color: var(--primary-color);
}
.btn-danger.is-loading::after { border-color: rgba(255,255,255,.45); border-top-color: #fff; }

/* Scoped-view banner -- e.g. helpdesk.html filtered to one customer's tickets. */
.filter-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-color);
  color: var(--secondary-color);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
.filter-banner svg { flex-shrink: 0; color: var(--primary-color); }
.filter-banner span { flex: 1; }
.filter-banner a {
  color: var(--primary-600);
  font-weight: 700;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--primary-color);
}
.filter-banner a:hover { background: var(--primary-color); color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: capitalize;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active { background: rgba(31,157,85,.12); color: var(--green); }
.badge-revoked, .badge-suspended { background: rgba(212,53,28,.10); color: var(--red); }

/* ---------- Provider entitlement chips (custom checkboxes) ---------- */
.providers-block-label {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
@keyframes chip-in {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.provider-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: #fff;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .1s ease;
  user-select: none;
  animation: chip-in .3s ease both;
}
.providers-grid .provider-chip:nth-child(1) { animation-delay: .01s; }
.providers-grid .provider-chip:nth-child(2) { animation-delay: .03s; }
.providers-grid .provider-chip:nth-child(3) { animation-delay: .05s; }
.providers-grid .provider-chip:nth-child(4) { animation-delay: .07s; }
.providers-grid .provider-chip:nth-child(5) { animation-delay: .09s; }
.providers-grid .provider-chip:nth-child(6) { animation-delay: .11s; }
.providers-grid .provider-chip:nth-child(7) { animation-delay: .13s; }
.providers-grid .provider-chip:nth-child(8) { animation-delay: .15s; }
.providers-grid .provider-chip:nth-child(9) { animation-delay: .17s; }
.providers-grid .provider-chip:nth-child(10) { animation-delay: .19s; }
.providers-grid .provider-chip:nth-child(11) { animation-delay: .21s; }
.providers-grid .provider-chip:nth-child(12) { animation-delay: .23s; }
.providers-grid .provider-chip:nth-child(n+13) { animation-delay: .25s; }
.provider-chip:hover { border-color: var(--primary-color); transform: translateY(-1px); }
.provider-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.provider-chip .chip-box {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.provider-chip .chip-box::after {
  content: "";
  width: 9px;
  height: 7px;
  clip-path: polygon(10% 40%, 0 55%, 38% 100%, 100% 18%, 88% 5%, 38% 73%);
  background: transparent;
  transition: background .1s ease;
}
.provider-chip .chip-label { text-transform: capitalize; }
.provider-chip.is-checked {
  border-color: var(--primary-color);
  background: var(--primary-soft);
  color: var(--secondary-color);
}
.provider-chip.is-checked .chip-box { background: var(--primary-color); border-color: var(--primary-color); }
.provider-chip.is-checked .chip-box::after { background: #fff; }

.duration-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.duration-pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.duration-pill:hover { border-color: var(--primary-color); color: var(--primary-color); }
.duration-pill.is-active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: #fff;
}

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; font-weight: 600; }
.field input {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .15s ease;
}
.field input:focus { outline: none; border-color: var(--primary-color); }

@keyframes banner-in {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.key-banner {
  background: #fff8f2;
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  animation: banner-in .3s cubic-bezier(.2,.8,.2,1) both;
}
.key-banner code {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  word-break: break-all;
  background: #fff;
  border: 1px solid var(--border);
  padding: 7px 9px;
  border-radius: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: var(--text-dim);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease, transform .12s ease;
}
.icon-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

/* Icon+label pill button -- shared between the admin "Apps" launcher and
   the Help Desk bell (both admin and sales topbars). */
.app-launcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: all .15s ease;
}
.app-launcher-btn:hover, .app-launcher.is-open .app-launcher-btn {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-soft);
}

/* ---------- Topbar Help Desk link badge -- shows the open-ticket count on
   the link to /admin/helpdesk (the full all-customers tickets page). ---------- */
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 53, 28, .45); }
  50% { box-shadow: 0 0 0 5px rgba(212, 53, 28, 0); }
}
.help-desk-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: badge-pulse 1.8s ease-in-out infinite;
}
@keyframes launcher-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Help desk tickets + their comment threads -- shared across
   the admin/sales detail views and the customer portal ---------- */
@keyframes ticket-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ticket-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  animation: ticket-in .3s ease both;
}
.ticket-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  cursor: pointer;
  transition: background .12s ease;
}
.ticket-row:hover { background: var(--secondary-soft); }
.ticket-subject { font-weight: 700; font-size: 13.5px; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-meta { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.ticket-id-lead {
  font-weight: 800;
  font-family: monospace;
  font-size: 12.5px;
  color: #000;
  flex-shrink: 0;
  white-space: nowrap;
}
.ticket-subject-sub {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-dim);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-row-info { display: flex; align-items: center; gap: 10px; flex: 0 1 480px; min-width: 0; }
.ticket-row-right {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  flex-shrink: 0;
}
.ticket-row-owner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 110px;
  flex-shrink: 0;
}
.ticket-row-customer { font-size: 12px; font-weight: 700; color: var(--secondary-color); white-space: nowrap; }
.ticket-row-claim { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.ticket-row-claim.is-claimed { color: var(--primary-600); font-weight: 600; }
.ticket-row-date { min-width: 90px; text-align: right; flex-shrink: 0; }
.ticket-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}
.ticket-badge.is-open { background: var(--primary-soft); color: var(--primary-600); }
.ticket-badge.is-resolved { background: rgba(31,157,85,.12); color: var(--green); }
.ticket-badge.is-unclaimed { background: var(--secondary-soft); color: var(--text-dim); }
.ticket-badge.is-progress { background: rgba(13,110,253,.12); color: #0d6efd; }
.ticket-chevron { color: var(--text-dim); transition: transform .15s ease; flex-shrink: 0; }
.ticket-card.is-expanded .ticket-chevron { transform: rotate(90deg); }
.ticket-thread { padding: 20px 24px; border-top: 1px solid var(--border); background: #fafbfd; }
.ticket-requester { font-size: 12px; color: var(--text-dim); margin: 0 0 12px; }
.ticket-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }

@keyframes shared-spin { to { transform: rotate(360deg); } }
.loading-spinner {
  width: 22px;
  height: 22px;
  margin: 18px auto;
  border: 3px solid var(--secondary-soft);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: shared-spin .7s linear infinite;
}

/* ---------- Support message list -- shared across the admin/sales detail
   views and the customer portal ---------- */
@keyframes support-item-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.support-item {
  padding: 12px 14px;
  border-radius: 12px;
  border-left: 3px solid transparent;
  background: var(--secondary-soft);
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--text);
  animation: support-item-in .3s ease both;
}
.support-item .support-date { font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; font-weight: 600; }
.support-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.support-sender { font-size: 11.5px; font-weight: 700; color: var(--secondary-color); }
.support-item.is-staff { background: var(--primary-soft); border-left-color: var(--primary-color); }
.support-item.is-staff .support-sender { color: var(--primary-600); }
.support-item.is-ai { background: #f4f6f9; border-left-color: var(--border); }
.support-item.is-ai .support-sender, .support-item.is-ai .support-text { color: var(--text-dim); font-style: italic; }

.support-reply-bar { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.support-reply-bar textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  background: #fbfcfe;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.support-reply-bar textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 4px var(--primary-soft); }

/* ---------- Ticket search/filter bar, ownership, events timeline,
   attachments -- shared across the admin Help Desk page and the portal ---------- */
.ticket-search-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.ticket-search-bar .btn { padding: 10px 20px; font-size: 13.5px; border-radius: 10px; }
.btn.is-active { border-color: var(--primary-color); background: var(--primary-color); color: #fff; }

.ticket-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--secondary-soft);
  font-size: 12.5px;
}
.ticket-toolbar-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.owner-label { font-weight: 700; color: var(--secondary-color); }
.owner-label.is-unclaimed { color: var(--text-dim); font-weight: 600; }
.ticket-toolbar select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  accent-color: var(--primary-color);
  cursor: pointer;
  transition: border-color .15s ease;
}
.ticket-toolbar select:hover { border-color: var(--secondary-color); }
.ticket-toolbar select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.ticket-toolbar select option {
  color: var(--text);
  background: #fff;
  padding: 8px;
}
.ticket-toolbar select option:checked { background: var(--primary-color); color: #fff; }

.ticket-events-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: #fff;
}
.ticket-events { margin: 0; padding: 0; list-style: none; }
.ticket-events li {
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 4px 0;
  border-left: 2px solid var(--border);
  padding-left: 10px;
  margin-left: 4px;
}
.ticket-events li strong { color: var(--text); }

.ticket-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ticket-attachments a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary-color);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.ticket-attachments a:hover { border-color: var(--primary-color); color: var(--primary-color); }

.empty {
  color: var(--text-dim);
  font-size: 13px;
  padding: 28px 12px;
  text-align: center;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- Login ---------- */
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg);
}
.login-card {
  position: relative;
  width: 340px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  text-align: center;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
}
.login-card img { height: 30px; margin-bottom: 18px; }
.login-card h2 { margin: 0 0 18px; color: var(--secondary-color); font-size: 16px; }
.login-card button {
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-600));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(242, 110, 34, .28);
  transition: transform .1s ease;
}
.login-card button:hover { transform: translateY(-1px); }
.login-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---------- Rezlive sync console ---------- */
.sync-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(242, 110, 34, .14), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #eef2f8 100%);
}
.sync-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}
.sync-hero {
  display: grid;
  grid-template-columns: 1.5fr .9fr;
  gap: 20px;
  margin-bottom: 22px;
}
.sync-hero h1 {
  font-size: 34px;
  line-height: 1.05;
  margin: 0 0 12px;
  color: var(--secondary-color);
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary-color);
}
.hero-copy {
  max-width: 760px;
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.7;
}
.hero-copy code {
  background: rgba(13, 56, 95, .08);
  border-radius: 6px;
  padding: 2px 6px;
}
.sync-actions-card,
.summary-card,
.sync-panel {
  border-radius: 22px;
  border: 1px solid rgba(13, 56, 95, .10);
  box-shadow: 0 22px 46px rgba(13, 56, 95, .09);
}
.sync-actions-card {
  background: linear-gradient(180deg, #fff 0%, #f6f9fd 100%);
  padding: 22px;
}
.sync-actions-card .field select,
.sync-actions-card .field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
}
.sync-button-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.sync-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(13, 56, 95, .06);
  color: var(--secondary-color);
}
.sync-status.is-loading {
  background: rgba(242, 110, 34, .10);
  color: var(--primary-600);
}
.sync-status.is-success {
  background: rgba(31,157,85,.12);
  color: var(--green);
}
.sync-status.is-error {
  background: rgba(212,53,28,.10);
  color: var(--red);
}
.sync-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.summary-card {
  background: linear-gradient(135deg, rgba(13, 56, 95, .96), rgba(10, 28, 50, .98));
  padding: 18px 20px;
  color: #f8fbff;
}
.summary-label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.summary-card strong {
  font-size: 28px;
  line-height: 1;
}
.sync-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.sync-panel {
  overflow: hidden;
}
.sync-panel-dark {
  background: linear-gradient(180deg, #10233d 0%, #091827 100%);
  color: #edf4ff;
}
.sync-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sync-panel-head h2 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}
.panel-pill {
  border-radius: 999px;
  background: rgba(242, 110, 34, .16);
  color: #ffb177;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}
.table-wrap {
  max-height: 560px;
  overflow: auto;
}
.sync-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.sync-table th,
.sync-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: top;
}
.sync-table th {
  position: sticky;
  top: 0;
  background: #112744;
  color: #8db8ea;
  z-index: 1;
}
.sync-table td {
  color: #dce9f8;
}
.sync-table tbody tr:hover {
  background: rgba(255,255,255,.04);
}
.sync-empty {
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 36px 20px;
}

@media (max-width: 1100px) {
  .sync-hero,
  .sync-preview-grid,
  .sync-summary-grid,
  .shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
  }
  .sync-shell,
  .shell {
    padding: 16px;
  }
  .sync-hero h1 {
    font-size: 28px;
  }
  .sync-button-row {
    flex-direction: column;
  }
}
