* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg1);
}

body,
button,
input {
  font-family: var(--font-sans);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.dc-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(rgba(19, 19, 22, 0.025) 1px, transparent 1px) 0 0 / 30px 30px,
    linear-gradient(90deg, rgba(19, 19, 22, 0.025) 1px, transparent 1px) 0 0 / 30px 30px,
    radial-gradient(circle at 82% 8%, rgba(216, 155, 0, 0.15), transparent 34%),
    var(--bg);
}

.dc-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 18px;
  overflow: auto;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 36%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--neutral-950);
}

.dc-brand,
.dc-nav a,
.dc-session-card button,
.dc-login-card button,
.dc-actions,
.dc-status-strip,
.dc-tabs,
.dc-filter,
.dc-panel-head,
.dc-badge {
  display: flex;
  align-items: center;
}

.dc-brand {
  gap: 11px;
  font-size: 21px;
  font-weight: 800;
}

.dc-brand img {
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(216, 155, 0, 0.34));
}

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

.dc-nav a {
  min-height: 40px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 800;
}

.dc-nav a.is-active {
  color: var(--fg-on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.dc-session-card {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 15px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-lg);
}

.dc-session-card strong {
  overflow: hidden;
  color: #fff;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-session-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.6;
}

.dc-session-card button,
.dc-login-card button,
.dc-actions button,
.dc-actions a,
.dc-tabs button,
.dc-filter button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 800;
}

.dc-session-card button,
.dc-login-card button,
.dc-actions button:first-child {
  justify-content: center;
  color: var(--fg-on-accent);
  background: var(--accent);
  box-shadow: var(--shadow-accent);
}

.dc-kicker {
  color: var(--accent-fg);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.dc-sidebar .dc-kicker {
  color: rgba(255, 255, 255, 0.55);
}

.dc-main {
  min-width: 0;
  padding: 26px;
}

body.is-locked .dc-main {
  filter: blur(2px);
  opacity: 0.45;
  pointer-events: none;
}

.dc-login-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 72% 18%, rgba(216, 155, 0, 0.18), transparent 34%),
    rgba(11, 11, 15, 0.72);
  backdrop-filter: blur(12px);
}

body.is-locked .dc-login-gate {
  display: grid;
}

.dc-login-card {
  display: grid;
  gap: 13px;
  width: min(440px, 100%);
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--neutral-950);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.dc-login-card h2 {
  margin: 0;
  font-size: 32px;
}

.dc-login-card p,
.dc-login-card small {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.6;
}

.dc-login-card label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.dc-login-card input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  outline: 0;
}

.dc-login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 155, 0, 0.18);
}

.dc-login-card button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.dc-top,
.dc-actions,
.dc-summary,
.dc-tabs,
.dc-panel {
  width: min(1240px, 100%);
  margin-inline: auto;
}

.dc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.dc-top h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 3.8vw, 50px);
  line-height: 1.12;
  letter-spacing: 0;
}

.dc-top p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--fg2);
  line-height: 1.75;
}

.dc-status-strip {
  flex: 0 0 auto;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.dc-status-strip div {
  display: grid;
  min-width: 112px;
  gap: 4px;
  padding: 9px 11px;
  background: var(--surface-inset);
  border-radius: var(--radius-md);
}

.dc-status-strip span {
  color: var(--fg3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.dc-status-strip b {
  font-size: 13px;
}

.dc-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.dc-actions button,
.dc-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}

.dc-ghost {
  color: var(--fg1);
  background: var(--surface);
  border: 1px solid var(--border);
}

.dc-summary {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dc-stat {
  grid-column: span 3;
  display: grid;
  gap: 7px;
  min-height: 116px;
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.dc-stat strong {
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: 0;
}

.dc-stat span {
  color: var(--fg3);
  font-size: 13px;
}

.dc-tabs {
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.dc-tabs button,
.dc-filter button {
  flex: 0 0 auto;
  padding: 0 13px;
  color: var(--fg2);
  background: var(--surface);
  border: 1px solid var(--border);
}

.dc-tabs button.is-active,
.dc-filter button.is-active {
  color: var(--fg-on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.dc-panel {
  min-width: 0;
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.dc-panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.dc-panel h2 {
  margin: 4px 0 0;
  font-size: 23px;
  line-height: 1.2;
}

.dc-filter {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dc-table-wrap {
  overflow-x: auto;
}

.dc-vision-panel {
  display: grid;
  gap: 14px;
}

.dc-vision-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dc-vision-grid article,
.dc-vision-note,
.dc-vision-warning {
  display: grid;
  gap: 7px;
  padding: 14px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.dc-vision-grid span,
.dc-vision-note span {
  color: var(--fg3);
  font-size: 12px;
}

.dc-vision-grid strong {
  font-size: 16px;
}

.dc-vision-note {
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: center;
}

.dc-vision-warning {
  color: #7a3a00;
  background: rgba(216, 155, 0, 0.14);
  border-color: rgba(216, 155, 0, 0.35);
}

.dc-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.dc-table th,
.dc-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: start;
  vertical-align: top;
  white-space: nowrap;
}

.dc-table th {
  color: var(--fg3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.dc-table td small {
  display: block;
  margin-top: 3px;
  color: var(--fg3);
  font-size: 12px;
}

.dc-badge {
  display: inline-flex;
  width: max-content;
  min-height: 26px;
  gap: 6px;
  padding: 0 9px;
  color: var(--fg2);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.dc-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
}

.dc-badge.warn::before {
  background: var(--warning);
}

.dc-badge.danger::before {
  background: var(--danger);
}

.dc-empty {
  padding: 28px;
  color: var(--fg2);
  background: var(--surface-inset);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  line-height: 1.7;
}

.dc-toast {
  position: fixed;
  right: 50%;
  bottom: 22px;
  z-index: 50;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 14px;
  color: #fff;
  background: var(--neutral-950);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateX(50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.dc-toast.show {
  transform: translateX(50%);
  opacity: 1;
}

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

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

  .dc-session-card {
    margin-top: 0;
  }

  .dc-top {
    flex-direction: column;
  }

  .dc-status-strip {
    width: 100%;
    overflow-x: auto;
  }

  .dc-stat {
    grid-column: span 6;
  }

  .dc-vision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dc-vision-note {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .dc-main,
  .dc-sidebar {
    padding: 16px;
  }

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

  .dc-top h1 {
    font-size: 30px;
  }

  .dc-status-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dc-stat {
    grid-column: 1 / -1;
  }

  .dc-panel {
    padding: 16px;
  }

  .dc-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dc-filter {
    justify-content: flex-start;
  }

  .dc-vision-grid,
  .dc-vision-note {
    grid-template-columns: 1fr;
  }
}
