:root {
  color-scheme: dark;
  --background: #071019;
  --panel: #0e1925;
  --panel-soft: #121f2d;
  --line: #24364a;
  --text: #eef5fb;
  --muted: #8fa4b7;
  --accent: #52d6a6;
  --accent-strong: #22b97f;
  --urgent: #ff6b76;
  --warning: #f3bd55;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -20%, rgba(82, 214, 166, 0.14), transparent 32rem),
    var(--background);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
select {
  color: inherit;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-strong);
}

.shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 0 4px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(24px, 3vw, 34px);
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.hidden {
  display: none !important;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.text-button,
.nav-item,
.dialog-close {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.text-button {
  color: var(--accent);
}

.login-card {
  width: min(560px, 100%);
  margin: 12vh auto 0;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(18, 31, 45, 0.98), rgba(10, 22, 32, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.login-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.primary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--accent);
  color: #062016;
  font-weight: 800;
  text-decoration: none;
}

.secondary-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
}

.workspace {
  display: grid;
  min-height: calc(100vh - 130px);
  grid-template-columns: 230px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 21, 32, 0.92);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(7, 16, 25, 0.6);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select {
  min-height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--panel-soft);
  color: var(--text);
}

.badge {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(82, 214, 166, 0.14);
  color: var(--accent);
  font-size: 11px;
  text-align: center;
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.content {
  min-width: 0;
  padding: clamp(22px, 4vw, 42px);
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}

.check {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
}

.cards {
  display: grid;
  gap: 10px;
}

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
}

.card:hover {
  border-color: #35516c;
  background: var(--panel-soft);
}

.card h3 {
  margin-bottom: 7px;
  font-size: 16px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #1b2a3a;
  color: #bbcad7;
  font-size: 11px;
  font-weight: 800;
}

.pill.urgent,
.diagnostic-error {
  background: rgba(255, 107, 118, 0.14);
  color: var(--urgent);
}

.pill.blocked,
.pill.review {
  background: rgba(243, 189, 85, 0.14);
  color: var(--warning);
}

.empty {
  padding: 48px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.error {
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 107, 118, 0.36);
  border-radius: 10px;
  background: rgba(255, 107, 118, 0.1);
  color: #ffb5bb;
}

dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: sticky;
  top: 0;
  float: right;
  color: var(--muted);
  font-size: 28px;
}

.detail-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-section p {
  white-space: pre-wrap;
}

.form-stack {
  display: grid;
  gap: 16px;
  clear: both;
}

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

.action-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

.attachment-link {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  overflow-wrap: anywhere;
}

@media (max-width: 800px) {
  .shell {
    padding: 12px;
  }

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .sidebar-note {
    display: none;
  }

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