:root {
  --steel: #0f2744;
  --steel-light: #1a3a5c;
  --accent: #1565c0;
  --accent-soft: #e3f2fd;
  --sky: #5eb3ff;
  --ink: #1a2332;
  --muted: #5a6578;
  --muted-light: #64748b;
  --line: #dde3ec;
  --line-soft: #eef2f7;
  --bg: #eef1f6;
  --surface: #ffffff;
  --success: #16a34a;
  --warn: #92400e;
  --radius: 12px;
  --sidebar: 248px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--steel);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
}

.skip:focus {
  left: 12px;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 68, 0.45);
  z-index: 45;
  border: none;
  cursor: pointer;
}

.sidebar {
  background: var(--steel);
  color: #c8d4e4;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
  padding: 0 0.5rem;
}

.brand span {
  color: var(--sky);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.side-nav a {
  color: #a8b8cc;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.side-nav a:hover,
.side-nav a.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side-nav a.is-active {
  background: rgba(94, 179, 255, 0.15);
  color: var(--sky);
}

.sidebar-foot {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--steel);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.sidebar-foot strong {
  display: block;
  color: #fff;
  font-size: 0.85rem;
}

.sidebar-foot span {
  color: #8fa3bc;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
}

.search {
  flex: 1;
  min-width: 180px;
  max-width: 480px;
}

.search input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: var(--bg);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.topbar-meta {
  font-size: 0.82rem;
  color: var(--muted-light);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: #1256a8;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.content {
  padding: 1.5rem;
  flex: 1;
}

.page-head {
  margin-bottom: 1.25rem;
}

.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  max-width: 52rem;
}

.page-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.breadcrumb {
  font-size: 0.82rem;
  color: var(--muted-light);
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: var(--accent);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stats article {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  border: 1px solid var(--line-soft);
}

.stats span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats strong {
  font-size: 1.85rem;
  display: block;
  margin: 0.2rem 0;
  letter-spacing: -0.03em;
}

.stats em {
  font-size: 0.78rem;
  color: var(--success);
  font-style: normal;
}

.stats em.neutral {
  color: var(--muted-light);
}

.grid {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 1rem;
}

.grid.single {
  grid-template-columns: 1fr;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.panel-head a {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.panel-head a:hover {
  text-decoration: underline;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

table.data th {
  color: var(--muted-light);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fafbfc;
}

table.data tr:hover td {
  background: #f8fafc;
}

table.data td.sub {
  color: var(--muted-light);
  font-size: 0.78rem;
}

table.data a.row-link {
  color: var(--accent);
  font-weight: 600;
}

table.data a.row-link:hover {
  text-decoration: underline;
}

.pill {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pill.warm {
  background: #fef3c7;
  color: var(--warn);
}

.pill.cool {
  background: #dbeafe;
  color: #1e40af;
}

.pill.hot {
  background: #fce7f3;
  color: #9d174d;
}

.pill.won {
  background: #dcfce7;
  color: #166534;
}

.pill.neutral {
  background: #f1f5f9;
  color: #475569;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1.15rem 1rem;
}

.activity-list li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.activity-list time {
  color: var(--muted-light);
  font-size: 0.78rem;
}

.activity-list p {
  margin: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line-soft);
  background: #fafbfc;
}

.filters select,
.filters input {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--surface);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
}

.detail-main .panel {
  margin-bottom: 1rem;
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 1rem 1.15rem;
  font-size: 0.88rem;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.meta-list span:first-child {
  color: var(--muted-light);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 1rem 1.15rem;
}

.timeline li {
  position: relative;
  padding-left: 1.25rem;
  padding-bottom: 1rem;
  font-size: 0.88rem;
  border-left: 2px solid var(--line);
  margin-left: 0.35rem;
}

.timeline li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline strong {
  display: block;
}

.timeline span {
  color: var(--muted-light);
  font-size: 0.78rem;
}

.settings-form {
  padding: 1.25rem 1.15rem;
  max-width: 520px;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.hero-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1rem;
}

.contact-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.contact-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted-light);
}

.contact-card a {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}

.demo-note {
  font-size: 0.75rem;
  color: var(--muted-light);
  padding: 0.75rem 1.15rem;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar), 88vw);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  body.nav-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}
