:root {
  --ink: #16202a;
  --muted: #667085;
  --line: #d7dde4;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --nav: #111827;
  --nav-2: #1f2937;
  --accent: #1f7a5f;
  --accent-strong: #0f6b52;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #b42318;
  --green: #027a48;
  --shadow: 0 22px 52px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #eef3f8 0%, #f8fafc 46%, #eef4f1 100%);
  background-size: 56px 56px, auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem;
  color: #d7dde4;
  background:
    linear-gradient(180deg, rgba(31, 122, 95, 0.2), transparent 34%),
    var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: white;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 0.15rem;
  color: #9ca3af;
  font-size: 0.74rem;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
  margin: 2rem 0;
}

.side-nav a {
  padding: 0.78rem 0.85rem;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 650;
}

.side-nav a:hover,
.side-nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.shift-card {
  margin-top: auto;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.shift-card span {
  color: #9ca3af;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.shift-card strong {
  display: block;
  margin: 0.4rem 0;
  color: white;
}

.shift-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.55;
}

main {
  min-width: 0;
  padding: 1.3rem;
}

.topbar,
.metrics-grid,
.workbench,
.knowledge-layout {
  max-width: 1240px;
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0 1.1rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.3rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.topbar-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.filter-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-weight: 800;
}

.primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.ghost-btn,
.filter-chip {
  background: white;
  color: var(--ink);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.95rem;
}

.metric-card,
.queue-panel,
.detail-panel,
.knowledge-layout {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 1rem;
}

.metric-card span,
.detail-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 0.35rem 0 0.15rem;
  font-size: 1.8rem;
}

.metric-card small {
  color: var(--muted);
}

.metric-card.warning strong {
  color: var(--amber);
}

.metric-card.success strong {
  color: var(--green);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(0, 1.35fr);
  gap: 0.95rem;
}

.queue-panel,
.detail-panel {
  min-height: 620px;
}

.panel-head,
.detail-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.search-control {
  min-width: 210px;
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-control input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  background: #f8fafc;
}

.filter-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.filter-chip {
  padding: 0.45rem 0.68rem;
  font-size: 0.78rem;
}

.filter-chip.active {
  border-color: rgba(31, 122, 95, 0.24);
  background: rgba(31, 122, 95, 0.12);
  color: var(--accent-strong);
}

.ticket-list {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
}

.ticket-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem;
  background: white;
  color: inherit;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.ticket-card:hover,
.ticket-card.active {
  transform: translateY(-2px);
  border-color: rgba(31, 122, 95, 0.35);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

.ticket-card-head,
.ticket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ticket-card h3 {
  margin: 0.45rem 0;
  font-size: 0.94rem;
  line-height: 1.35;
}

.ticket-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.52rem;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.badge.high,
.status-pill.high {
  background: rgba(180, 35, 24, 0.1);
  color: var(--red);
}

.badge.medium,
.status-pill.medium {
  background: rgba(180, 83, 9, 0.12);
  color: var(--amber);
}

.badge.low,
.status-pill.low {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.ticket-id {
  margin-bottom: 0.35rem;
  color: var(--accent-strong);
  font-weight: 850;
  letter-spacing: 0.03em;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.detail-grid div,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.detail-grid div {
  padding: 0.85rem;
}

.detail-grid strong {
  display: block;
  margin-top: 0.32rem;
  font-size: 0.92rem;
}

.detail-section {
  margin: 1rem;
  padding: 1rem;
}

.detail-section h3 {
  margin-bottom: 0.55rem;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-section p {
  margin-bottom: 0;
  color: #475467;
  line-height: 1.65;
}

.timeline {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding-left: 1.2rem;
}

.timeline li {
  padding-left: 0.25rem;
  color: #475467;
  line-height: 1.55;
}

.split-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.knowledge-layout {
  margin-top: 0.95rem;
  padding: 1rem;
}

.kb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.kb-grid article {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.kb-grid span {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.kb-grid h3 {
  margin: 0.35rem 0 0.45rem;
  font-size: 0.92rem;
}

.kb-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .workbench,
  .metrics-grid,
  .kb-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main {
    padding: 0.8rem;
  }

  .topbar,
  .panel-head,
  .detail-top,
  .split-section {
    flex-direction: column;
    display: flex;
  }

  .side-nav {
    grid-template-columns: 1fr 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
