/*
 * OneFit Central - visual system.
 *
 * Tokens, typography, radii and shadows are copied from the Executive
 * Dashboard so Central reads as the same product family. This file is
 * Central-specific on purpose: the Executive Dashboard is not modified, and
 * no shared stylesheet is touched, so no other OneFit page can regress from a
 * change made here.
 *
 * The layout intent differs from the dashboard: this is a command centre built
 * around search and a person, not a page of charts.
 */

:root {
  --green: #acd037;
  --green-hover: #b8df3d;
  --ink: #161D42;
  --text: #1f1f1f;
  --muted: rgba(0, 0, 0, .62);
  --faint: rgba(0, 0, 0, .45);
  --soft: #f6f6f4;
  --line: rgba(0, 0, 0, .09);
  --card: rgba(255, 255, 255, .88);
  --dark: #101010;
  --red: #b42318;
  --amber: #b54708;
  --blue: #1677ff;
  --gold: #c18b21;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow-soft: 0 24px 70px rgba(0, 0, 0, .10);
  --shadow-lift: 0 12px 32px rgba(0, 0, 0, .07);

  --font-display: Impact, Haettenschweiler, "Arial Black", sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 13% 6%, rgba(172, 208, 55, .12), transparent 28%),
    linear-gradient(180deg, #fff 0%, #fbfbfa 42%, #f6f6f4 100%);
  background-attachment: fixed;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px 12px 18px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 116px;
  height: 52px;
  border-radius: 18px;
  background: var(--dark);
  flex: 0 0 auto;
}

.brand-logo img { width: 88px; height: 40px; object-fit: contain; }

.eyebrow {
  color: #719100;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin: 0;
}

.brand h1 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: .6px;
  color: var(--ink);
  text-transform: uppercase;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-primary { background: var(--green); border-color: transparent; color: #12200a; }
.btn-primary:hover:not(:disabled) { background: var(--green-hover); }
.btn-ghost { background: transparent; }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Cards ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-lift);
  padding: 20px 22px;
}

.card-lg { border-radius: var(--radius-lg); padding: 26px 28px; }

.card-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink);
}

.card-sub { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.section { margin-top: 22px; }

/* ---------- Search ---------- */

.search-hero { margin-top: 22px; }

.search-form { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }

.search-input {
  flex: 1 1 320px;
  min-width: 0;
  padding: 18px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 17px;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
}

.search-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(172, 208, 55, .25);
}

.search-meta { margin-top: 12px; font-size: 12px; color: var(--faint); }

/* ---------- Result rows ---------- */

.result {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) minmax(180px, 1fr) minmax(200px, 1.2fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.result:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.result-name { font-weight: 800; font-size: 16px; color: var(--ink); }
.result-line { font-size: 13px; color: var(--muted); margin-top: 3px; }
.result-mono { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }

/* ---------- Pills / chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
}

.chip-good { background: rgba(172, 208, 55, .18); border-color: rgba(172, 208, 55, .5); color: #4c6100; }
.chip-warn { background: rgba(181, 71, 8, .10); border-color: rgba(181, 71, 8, .3); color: var(--amber); }
.chip-bad { background: rgba(180, 35, 24, .10); border-color: rgba(180, 35, 24, .3); color: var(--red); }
.chip-info { background: rgba(22, 119, 255, .10); border-color: rgba(22, 119, 255, .3); color: var(--blue); }
.chip-idle { background: var(--soft); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- States ---------- */

.state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: rgba(255, 255, 255, .6);
}

.state-error {
  border-style: solid;
  border-color: rgba(180, 35, 24, .35);
  background: rgba(180, 35, 24, .06);
  color: var(--red);
  text-align: left;
}

.state-title { display: block; font-weight: 800; margin-bottom: 6px; color: inherit; }
.state code { font-family: var(--font-mono); font-size: 12px; }

.skeleton {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .10), rgba(0, 0, 0, .05));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  margin-bottom: 10px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .btn:hover, .result:hover { transform: none; }
}

/* ---------- Integration health ---------- */

.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.health-row:last-child { border-bottom: none; }
.health-name { font-weight: 800; font-size: 14px; color: var(--ink); }
.health-detail { font-size: 12px; color: var(--muted); margin-top: 3px; max-width: 62ch; line-height: 1.45; }

/* ---------- Attention list ---------- */

.attention-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.attention-item:last-child { border-bottom: none; }
.attention-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.attention-detail { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ---------- Profile ---------- */

.profile-header { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.avatar {
  width: 76px; height: 76px; border-radius: 24px; flex: 0 0 auto;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 28px; letter-spacing: 1px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-id { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: 8px; word-break: break-all; }
.profile-name { margin: 0; font-family: var(--font-display); font-size: 32px; letter-spacing: .6px; color: var(--ink); text-transform: uppercase; }
.profile-contact { font-size: 14px; color: var(--muted); margin-top: 6px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 20px; }
.fact-label { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--faint); }
.fact-value { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 4px; word-break: break-word; }
.fact-value.muted { font-weight: 500; color: var(--faint); font-style: italic; }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  scrollbar-width: thin;
}

.tab {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.tab[aria-selected="true"] { background: var(--ink); color: #fff; }

/* ---------- Timeline ---------- */

.timeline { position: relative; padding-left: 26px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line);
}

.tl-event { position: relative; padding: 0 0 20px; }

.tl-event::before {
  content: "";
  position: absolute;
  left: -23px; top: 5px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--green);
}

.tl-event[data-category="payment"]::before { border-color: var(--gold); }
.tl-event[data-category="booking"]::before { border-color: var(--blue); }
.tl-event[data-category="membership"]::before { border-color: var(--ink); }

.tl-time { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); }
.tl-title { font-weight: 700; font-size: 14.5px; color: var(--ink); margin-top: 2px; }
.tl-desc { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.tl-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 7px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
table.data th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--faint);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }

/* ---------- Conflicts ---------- */

.conflict {
  border: 1px solid rgba(181, 71, 8, .32);
  background: rgba(181, 71, 8, .06);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.conflict-field { font-weight: 800; font-size: 12px; letter-spacing: .8px; text-transform: uppercase; color: var(--amber); }
.conflict-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; }
.conflict-value { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }

/* ---------- AI ---------- */

.ai-card {
  border: 1px solid rgba(172, 208, 55, .45);
  background: linear-gradient(135deg, rgba(172, 208, 55, .12), rgba(255, 255, 255, .9));
}

.reco { padding: 12px 0; border-bottom: 1px solid var(--line); }
.reco:last-child { border-bottom: none; }
.reco-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.reco-why { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.reco-why strong { color: var(--ink); }

/* ---------- Access gate ---------- */

.gate { max-width: 460px; margin: 60px auto; }
.gate input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.gate input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(172, 208, 55, .22); }

.hidden { display: none !important; }

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

@media (max-width: 900px) {
  .result { grid-template-columns: 1fr; gap: 10px; }
  .profile-name { font-size: 26px; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 20px); }
  .topbar { border-radius: var(--radius-md); flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .card { padding: 16px; }
  .card-lg { padding: 20px; border-radius: var(--radius-md); }
}

/* ---------- Phase 3: staff identity ---------- */

.staff-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.staff-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .5px;
}

.staff-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.staff-name { font-weight: 800; font-size: 13px; color: var(--ink); }
.staff-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--faint);
}

.btn-small { padding: 6px 12px; font-size: 12px; }

.gate input + input { margin-top: 2px; }

/* ---------- Phase 3: match evidence ---------- */

.evidence-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
}

.evidence-row:last-child { border-bottom: none; }
.evidence-tick { color: #4c6100; font-weight: 900; flex: 0 0 auto; }
.evidence-label { font-weight: 700; color: var(--ink); }
.evidence-values { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 2px; }

.match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.match-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; }
.match-side { min-width: 0; }
.match-provider {
  font-size: 11px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--faint);
}
.match-value { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); margin-top: 3px; word-break: break-all; }
.match-link { font-size: 22px; color: var(--faint); text-align: center; }

@media (max-width: 700px) {
  .match-sides { grid-template-columns: 1fr; }
  .match-link { display: none; }
  .staff-meta { display: none; }
}

/* ---------- Phase 3: composer ---------- */

.composer { margin-top: 14px; }

.composer textarea,
.composer input[type="text"],
.composer input[type="date"],
.composer select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 10px;
  font-size: 14px;
}

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

.composer textarea:focus,
.composer input:focus,
.composer select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(172, 208, 55, .22);
}

.composer-row { display: flex; gap: 10px; flex-wrap: wrap; }
.composer-row > * { flex: 1 1 160px; }


/* Phase 6 - batch review bar. Sticks so the selection stays reachable while
   scrolling a long queue. */
.batch-bar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 12px 18px;
  border-radius: 20px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}
.batch-bar .btn { margin-left: auto; }
.batch-bar .btn + .btn { margin-left: 8px; }

.match-card.is-selected { outline: 3px solid var(--green); }

.match-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}
.match-select input { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
