@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Sora:wght@400;600;700;800&display=swap");

:root {
  --bg: #f3f6ff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(9, 29, 79, 0.18);
  --ink: #091d4f;
  --muted: #3f4f75;
  --accent: #123eac;
  --accent-soft: rgba(18, 62, 172, 0.12);
  --warning: #a66d0a;
  --danger: #ad2f2f;
  --success: #123eac;
  --brand-yellow: #faed36;
  --shadow: 0 18px 48px rgba(9, 29, 79, 0.14);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Sora", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.7;
}

.bg-layer-a {
  width: 460px;
  height: 460px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle at 30% 35%, #fff8a4, #faed36 72%);
  animation: drift-a 18s ease-in-out infinite alternate;
}

.bg-layer-b {
  width: 360px;
  height: 360px;
  left: -120px;
  bottom: -100px;
  background: radial-gradient(circle at 50% 50%, #6b8de0, #091d4f 76%);
  animation: drift-b 20s ease-in-out infinite alternate;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1500px, 96vw);
  margin: 20px auto 30px auto;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.top-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 22px;
  margin-bottom: 16px;
  animation: reveal-up 0.45s ease-out;
}

.kicker {
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 2.05rem);
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.stats-cluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
  align-self: center;
}

.stat-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  min-width: 110px;
}

.stat-label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-value {
  margin: 6px 0 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.stat-value.warning {
  color: var(--warning);
}

.stat-value.success {
  color: var(--success);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.dashboard-grid > .panel {
  min-width: 0;
}

.intake-panel,
.mapping-panel,
.coach-panel {
  padding: 16px;
  min-width: 0;
  animation: reveal-up 0.55s ease-out;
}

.mapping-panel {
  animation-delay: 0.08s;
}

.coach-panel {
  animation-delay: 0.16s;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

button {
  font-family: "Sora", sans-serif;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 10px 12px;
  transition: transform 0.17s ease, filter 0.17s ease, box-shadow 0.17s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #123eac;
  outline-offset: 2px;
}

.primary-btn {
  background: linear-gradient(145deg, #1d3770, #091d4f);
  color: #f7f7ff;
  border: 1px solid rgba(250, 237, 54, 0.46);
  font-weight: 700;
}

.primary-btn.cta-focus {
  box-shadow: 0 0 0 3px rgba(250, 237, 54, 0.24);
  animation: cta-pulse 1.15s ease-in-out infinite;
}

.secondary-btn {
  background: #faed36;
  color: #091d4f;
  border: 1px solid rgba(9, 29, 79, 0.24);
  font-weight: 600;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  color: #1b3266;
  font-weight: 600;
}

.drop-zone {
  margin-top: 10px;
  padding: 20px 14px;
  border-radius: var(--radius-md);
  border: 1.5px dashed rgba(18, 62, 172, 0.42);
  background: linear-gradient(180deg, #f7f9ff, #eef3ff);
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.drop-zone.active {
  border-color: var(--accent);
  background: #e8efff;
}

.drop-zone.loaded {
  border-style: solid;
  border-color: rgba(24, 58, 130, 0.62);
  background: linear-gradient(180deg, #f2ec8f, #fff7cb);
  box-shadow: inset 0 0 0 1px rgba(24, 58, 130, 0.2);
}

.drop-title {
  margin: 0;
  font-weight: 700;
}

.drop-sub,
.drop-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.drop-hint {
  font-size: 0.75rem;
}

.action-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.input-label {
  display: block;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  resize: vertical;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #162b5a;
  background: rgba(255, 255, 255, 0.75);
}

.handoff-textarea {
  margin-top: 6px;
  min-height: 56px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.handoff-textarea[readonly] {
  background: rgba(248, 251, 255, 0.96);
}

.handoff-btn {
  width: 100%;
  margin-top: 6px;
}

.session-meta {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.session-meta p {
  margin: 4px 0;
}

.warning-box {
  margin-top: 10px;
  border: 1px solid rgba(166, 109, 10, 0.4);
  background: rgba(250, 237, 54, 0.2);
  color: #5f4308;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

.completed-tracker {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
}

.completed-tracker-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
}

.completed-item {
  border: 1px solid rgba(9, 29, 79, 0.16);
  border-left: 4px solid #123eac;
  border-radius: 8px;
  padding: 8px;
  background: rgba(247, 249, 255, 0.9);
  display: grid;
  gap: 6px;
}

.completed-item-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
}

.completed-item-meta {
  margin: 0;
  font-size: 0.67rem;
  color: var(--muted);
}

.undo-btn {
  justify-self: start;
  padding: 5px 8px;
  font-size: 0.67rem;
  border: 1px solid rgba(9, 29, 79, 0.2);
  background: #fff;
  color: #1b3266;
  border-radius: 6px;
}

.filter-bar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}

.map-controls {
  margin-top: 8px;
}

.quick-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) auto auto;
  gap: 8px;
  align-items: center;
  margin: 4px 0 10px;
}

.quick-tools button {
  white-space: nowrap;
}

.workflow-pill {
  margin: 0;
  border: 1px solid rgba(18, 62, 172, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #123eac;
  background: rgba(18, 62, 172, 0.07);
}

.sop-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(18, 62, 172, 0.3);
  background: rgba(18, 62, 172, 0.09);
  color: #123eac;
  font-size: 0.74rem;
  font-weight: 600;
}

.search-input {
  width: 100%;
  border: 1px solid rgba(9, 29, 79, 0.16);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.72);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: #123eac;
}

.select-input {
  width: 100%;
  border: 1px solid rgba(9, 29, 79, 0.16);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.8);
  color: #1b3266;
  font-size: 0.74rem;
  font-family: "Sora", sans-serif;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: #123eac;
  padding: 7px 10px;
  font-size: 0.74rem;
}

.filter-btn.active {
  background: var(--accent-soft);
  border-color: rgba(18, 62, 172, 0.36);
  color: #091d4f;
}

.table-wrap {
  max-height: 72vh;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid rgba(9, 29, 79, 0.09);
  padding: 9px 8px;
  vertical-align: middle;
  font-size: 0.75rem;
  height: 110px;
  overflow: hidden;
}

tbody tr {
  height: 110px;
}

thead th {
  position: sticky;
  top: 0;
  background: #edf2ff;
  z-index: 2;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  height: auto;
}

th:nth-child(1) { width: 4%; }
th:nth-child(2) { width: 12%; }
th:nth-child(3) { width: 16%; }
th:nth-child(4) { width: 24%; }
th:nth-child(5) { width: 12%; }
th:nth-child(6) { width: 16%; }
th:nth-child(7) { width: 16%; }

.row-field {
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.row-tab {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.value-input {
  width: 100%;
  border: 1px solid rgba(9, 29, 79, 0.18);
  border-radius: 7px;
  padding: 7px;
  font-size: 0.74rem;
  font-family: "IBM Plex Mono", monospace;
  margin-bottom: 4px;
}

.source-preview {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.path-preview {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.details-preview {
  display: grid;
  gap: 6px;
}

.details-preview-text {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.details-more-btn {
  justify-self: start;
  padding: 5px 8px;
  font-size: 0.67rem;
  border: 1px solid rgba(9, 29, 79, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #1f356d;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.chip-ready {
  color: #123eac;
  background: rgba(18, 62, 172, 0.14);
  border-color: rgba(18, 62, 172, 0.3);
}

.chip-review {
  color: #8e4d15;
  background: rgba(226, 158, 48, 0.18);
  border-color: rgba(181, 113, 20, 0.32);
}

.chip-missing {
  color: #922d2d;
  background: rgba(229, 90, 90, 0.14);
  border-color: rgba(165, 38, 38, 0.3);
}

.priority-high {
  color: #091d4f;
  background: rgba(250, 237, 54, 0.32);
  border-color: rgba(9, 29, 79, 0.3);
}

.priority-medium {
  color: #123eac;
  background: rgba(18, 62, 172, 0.12);
  border-color: rgba(18, 62, 172, 0.3);
}

.priority-low {
  color: #3f4f75;
  background: rgba(63, 79, 117, 0.12);
  border-color: rgba(63, 79, 117, 0.24);
}

.priority-role-other {
  color: #3f4f75;
  background: rgba(63, 79, 117, 0.14);
  border-color: rgba(63, 79, 117, 0.28);
}

.req-flag {
  display: inline-block;
  margin-left: 4px;
  margin-top: 4px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1f356d;
}

.stage-flag {
  display: inline-block;
  margin-left: 4px;
  margin-top: 4px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #213c77;
  background: rgba(9, 29, 79, 0.08);
  border-radius: 999px;
  padding: 2px 6px;
}

.row-selected {
  background: rgba(18, 62, 172, 0.09);
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  color: #1f356d;
}

.coach-content {
  min-height: 210px;
}

.coach-content h3 {
  margin: 4px 0 8px;
  font-size: 0.98rem;
}

.screen-guide {
  margin-top: 12px;
  border-top: 1px solid rgba(16, 32, 30, 0.12);
  padding-top: 10px;
}

.screen-frame {
  position: relative;
  margin-top: 8px;
  border: 1px solid rgba(16, 32, 30, 0.2);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.screen-frame img {
  width: 100%;
  display: block;
}

.screen-hotspot {
  position: absolute;
  border: 2px solid #faed36;
  box-shadow: 0 0 0 9999px rgba(250, 237, 54, 0.12);
  border-radius: 4px;
  pointer-events: none;
}

.screen-guide a {
  color: #123eac;
  font-weight: 600;
}

.coach-list {
  margin: 0;
  padding-left: 19px;
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
}

.muted {
  color: var(--muted);
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

.coach-panel h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.roadmap {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 45, 0.58);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  width: min(480px, 94vw);
  border-radius: 14px;
  border: 1px solid rgba(9, 29, 79, 0.18);
  border-top: 4px solid #123eac;
  background: #fff;
  color: var(--ink);
  padding: 16px;
  box-shadow: 0 22px 60px rgba(6, 17, 49, 0.3);
  animation: modal-pop 0.22s ease-out;
}

.details-modal-card {
  width: min(760px, 95vw);
}

.details-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.details-close-btn {
  padding: 6px 9px;
}

.details-modal-body {
  margin-top: 10px;
  border: 1px solid rgba(9, 29, 79, 0.14);
  border-radius: 8px;
  padding: 10px;
  max-height: 62vh;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 0.8rem;
  line-height: 1.5;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift-a {
  from {
    transform: translateY(0) translateX(0) scale(1);
  }
  to {
    transform: translateY(24px) translateX(18px) scale(1.06);
  }
}

@keyframes drift-b {
  from {
    transform: translateY(0) translateX(0) scale(1);
  }
  to {
    transform: translateY(-14px) translateX(24px) scale(1.07);
  }
}

@keyframes cta-pulse {
  0% {
    transform: translateY(0);
    filter: saturate(1);
    box-shadow: 0 0 0 0 rgba(250, 237, 54, 0.4);
  }
  50% {
    transform: translateY(-1px);
    filter: saturate(1.12);
    box-shadow: 0 0 0 8px rgba(250, 237, 54, 0.24);
  }
  100% {
    transform: translateY(0);
    filter: saturate(1);
    box-shadow: 0 0 0 0 rgba(250, 237, 54, 0.38);
  }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1240px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    max-height: 56vh;
  }

  .stats-cluster {
    grid-template-columns: repeat(3, minmax(82px, 1fr));
  }

  .quick-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1480px) and (min-width: 1241px) {
  .dashboard-grid {
    grid-template-columns: 300px minmax(0, 1fr) 300px;
  }

  .quick-tools {
    grid-template-columns: minmax(0, 1fr) minmax(170px, 1fr);
  }

  .quick-tools button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: 95vw;
    margin-top: 14px;
  }

  .top-header {
    grid-template-columns: 1fr;
  }

  .stats-cluster {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
