:root {
  --bg: #f8f3ea;
  --surface: #fff7ee;
  --surface-strong: #f4e8db;
  --ink: #1b1a16;
  --muted: #5c534f;
  --accent: #1f6f78;
  --accent-2: #d37b45;
  --accent-3: #ad4f2f;
  --line: #e0d4c6;
  --shadow: 0 24px 50px rgba(27, 26, 22, 0.12);
  --radius: 18px;
  --font-display: "Fraunces", serif;
  --font-body: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.link-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(31, 111, 120, 0.4);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0.5px);
  opacity: 0.7;
}

.orb-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -120px;
  background: radial-gradient(circle at 30% 30%, #ffe9c9, #f7c77f 60%, rgba(255, 255, 255, 0));
}

.orb-2 {
  width: 520px;
  height: 520px;
  bottom: -180px;
  left: -160px;
  background: radial-gradient(circle at 70% 30%, #d7f2f0, #8fc2c7 65%, rgba(255, 255, 255, 0));
}

.grid-noise {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.3;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 247, 238, 0.8);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 0.06em;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  text-align: left;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  font-weight: 600;
  color: var(--muted);
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(31, 111, 120, 0.15);
  color: var(--ink);
}

.sidebar-metrics {
  display: grid;
  gap: 16px;
}

.metric-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 30px rgba(27, 26, 22, 0.08);
}

.metric-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.metric-list {
  display: grid;
  gap: 8px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(31, 111, 120, 0.12);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  font-size: 12px;
  color: var(--muted);
}

.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 36px 10px;
  gap: 16px;
}

.search-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.search-box input {
  border: none;
  background: transparent;
  padding: 8px 0;
  min-width: 280px;
}

.search-box input:focus {
  outline: none;
}

.search-icon {
  font-size: 18px;
  color: var(--accent-3);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.language-switch {
  display: grid;
  gap: 4px;
}

.language-switch select {
  min-width: 120px;
}

.primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(31, 111, 120, 0.25);
}

.ghost {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.content {
  padding: 12px 36px 40px;
  display: grid;
  gap: 24px;
}

.view {
  display: none;
  animation: fadeUp 0.45s ease;
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.view-title {
  font-family: var(--font-display);
  font-size: 32px;
  margin: 0;
}

.view-subtitle {
  color: var(--muted);
  margin-top: 6px;
}

.card {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card.soft {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.6);
}

.card-grid {
  display: grid;
  gap: 16px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 20px;
}

.stack {
  display: grid;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(31, 111, 120, 0.15);
  color: var(--accent);
}

.badge.warn {
  background: rgba(211, 123, 69, 0.2);
  color: var(--accent-2);
}

.badge.alert {
  background: rgba(173, 79, 47, 0.2);
  color: var(--accent-3);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 111, 120, 0.12);
  font-size: 12px;
  font-weight: 600;
}

.tag.alt {
  background: rgba(211, 123, 69, 0.2);
}

.field-row {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 0.6fr 0.6fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.field-row:last-child {
  border-bottom: none;
}

.field-row.low-confidence {
  background: rgba(211, 123, 69, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.field-row.conflict {
  background: rgba(173, 79, 47, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.field-actions {
  display: flex;
  gap: 8px;
}

.field-actions button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 111, 120, 0.12);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.interaction-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.pending-list {
  align-content: start;
}

.pending-list .pending-item {
  height: 120px;
  overflow: hidden;
}

.pending-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.interaction-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(27, 26, 22, 0.12);
}

.interaction-card.active {
  border-color: rgba(31, 111, 120, 0.6);
  background: rgba(31, 111, 120, 0.08);
}

.candidate-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  transition: 0.2s ease;
}

.candidate-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(27, 26, 22, 0.12);
}

.company-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  transition: 0.2s ease;
}

.company-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(27, 26, 22, 0.12);
}

.candidate-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.candidate-name {
  font-size: 18px;
  font-weight: 600;
}

.candidate-headline {
  color: var(--muted);
  font-size: 14px;
}

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

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.pending-row {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 4px;
}

.org-graph {
  display: grid;
  gap: 16px;
}

.org-branch {
  display: grid;
  gap: 12px;
  position: relative;
}

.org-children {
  display: grid;
  gap: 12px;
  margin-left: 18px;
  padding-left: 16px;
  border-left: 1px dashed rgba(31, 111, 120, 0.2);
}

.org-children .org-branch::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 22px;
  width: 16px;
  height: 1px;
  background: rgba(31, 111, 120, 0.2);
}

.org-node {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.org-node.fog {
  border-style: dashed;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.org-node.spotlight {
  border-color: rgba(31, 111, 120, 0.7);
  box-shadow: 0 0 0 1px rgba(31, 111, 120, 0.2);
  background: rgba(31, 111, 120, 0.08);
}

.org-title {
  font-size: 15px;
  font-weight: 600;
}

.org-meta {
  font-size: 12px;
  color: var(--muted);
}

.segment {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 6px;
}

.segment.highlight {
  border-color: rgba(31, 111, 120, 0.7);
  background: rgba(31, 111, 120, 0.1);
}

.segment-time {
  font-size: 12px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 14, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 5;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 30px 60px rgba(20, 17, 14, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(31, 111, 120, 0.9);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  z-index: 6;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
}

.chip.active {
  background: rgba(31, 111, 120, 0.2);
  border-color: rgba(31, 111, 120, 0.5);
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  gap: 10px;
}

.kpi-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.audit-item .link-button {
  font-size: 12px;
  word-break: break-all;
}

.two-column {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.hero {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
}

.hero h2 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 28px;
}

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

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 900px) {
  .split-layout,
  .two-column {
    grid-template-columns: 1fr;
  }

  .search-box input {
    min-width: 160px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .topbar {
    padding: 20px 20px 10px;
  }

  .content {
    padding: 10px 20px 32px;
  }
}

@media (max-width: 600px) {
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .search-block {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }
}
