:root {
  color-scheme: light dark;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f4f8;
  --text: #111827;
  --muted: #667085;
  --line: #d9dee8;
  --brand: #0b2545;
  --brand-2: #2e74b5;
  --accent: #12a37f;
  --dot-muted: #c5ccd6;
  --warning: #9a6700;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --sidebar: 292px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #171d26;
    --surface-soft: #202838;
    --text: #edf2f7;
    --muted: #aab4c2;
    --line: #303948;
    --brand: #d8e8ff;
    --brand-2: #8dc4ff;
    --accent: #32d09a;
    --dot-muted: #566174;
    --warning: #f6c85f;
    --danger: #ff8b7f;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--brand);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand);
}

.sidebar-toggle {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text);
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-soft);
}

.recent-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
}

.recent-dot.found {
  background: var(--accent);
}

.recent-dot.missing {
  background: var(--dot-muted);
}

.main {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

.mobile-menu {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.topbar-spacer {
  flex: 1;
}

.lang-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lang-select {
  min-height: 38px;
  min-width: 154px;
  border: 0;
  border-radius: 8px;
  padding: 8px 34px 8px 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  appearance: none;
}

.lang-select-wrap::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  color: var(--muted);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero-search {
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.search-panel {
  width: min(780px, 100%);
  text-align: center;
}

.eyebrow {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.hero-title {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy {
  margin: 0 auto 28px;
  max-width: 660px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 13px 12px;
  font-size: 16px;
}

.hint-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.card h3 {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 18px;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.section-title {
  margin: 0 0 16px;
  color: var(--brand);
  font-size: 28px;
}

.section-copy {
  color: var(--muted);
  line-height: 1.7;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  outline: 0;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.status.warning {
  color: var(--warning);
}

.status.danger {
  color: var(--danger);
}

.case-list {
  display: grid;
  gap: 12px;
}

.case-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.footer-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.home-main {
  background:
    radial-gradient(circle at 78% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 30%),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 68%);
}

.home-topbar {
  border-bottom: 0;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.home-screen {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.home-card {
  max-width: 520px;
  margin: 0 auto;
}

.home-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 12px 0 28px;
}

.home-logo {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  object-fit: cover;
  background: #fff;
}

.home-brand-name {
  margin: 0;
  color: var(--brand);
  font-size: clamp(34px, 7vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.home-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.home-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 14px 12px;
  background: transparent;
  color: var(--text);
}

.search-icon-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 10px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}

.home-section {
  margin-top: 34px;
}

.home-section-title {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 17px;
  font-weight: 800;
}

.recent-searches {
  display: grid;
  gap: 12px;
}

.recent-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.recent-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.risk-pill.low {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  color: color-mix(in srgb, var(--accent) 76%, #003b32);
}

.risk-pill.medium {
  background: color-mix(in srgb, var(--warning) 14%, var(--surface));
  color: var(--warning);
}

.risk-pill.high {
  background: color-mix(in srgb, var(--danger) 13%, var(--surface));
  color: var(--danger);
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.home-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.home-action strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
}

.home-action span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 74px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  align-items: center;
}

body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .sidebar .chip {
  display: none;
}

body.sidebar-collapsed .recent-dot {
  display: block;
}

body.sidebar-collapsed .sidebar-toggle {
  margin-left: 0;
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-toggle {
    display: none;
  }

  .topbar {
    padding: 12px 16px;
  }

  .home-topbar strong {
    display: none;
  }

  .home-topbar .btn {
    display: none;
  }

  .home-topbar .lang-select {
    min-width: 116px;
  }

  .hero-search {
    align-items: flex-start;
    min-height: auto;
    padding-top: 48px;
  }

  .search-box {
    display: grid;
  }

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

  .grid,
  .split {
    grid-template-columns: 1fr;
  }

  .case-row {
    grid-template-columns: 1fr;
  }

  .home-screen {
    width: min(100% - 32px, 430px);
    padding-top: 28px;
  }

  .home-card {
    max-width: 100%;
  }

  .home-brand {
    justify-content: flex-start;
    margin-top: 18px;
  }

  .home-logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .home-brand-name {
    font-size: 34px;
  }

  .home-actions {
    grid-template-columns: 1fr;
  }
}
