:root {
  color-scheme: dark;
  --bg: #090b0f;
  --bg-soft: #0d1118;
  --surface: #111821;
  --surface-strong: #151e29;
  --surface-soft: #0f151d;
  --line: #253142;
  --line-soft: #1b2633;
  --text: #edf4f7;
  --text-soft: #a7b4c2;
  --text-muted: #718094;
  --accent: #42d88f;
  --accent-strong: #7cf8b7;
  --accent-dark: #0f3b2c;
  --danger: #fb7185;
  --danger-bg: #35161d;
  --warning: #f6c56f;
  --warning-bg: #342713;
  --radius: 10px;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(66, 216, 143, 0.08), transparent 340px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 64px 64px, 64px 64px, auto;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::selection {
  background: rgba(66, 216, 143, 0.32);
  color: var(--text);
}

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

button {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

button:active {
  transform: translateY(1px);
}

a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
}

a:hover {
  color: #b7ffd8;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(480px, 100%);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.login-panel h1,
.sidebar h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

.login-panel h1,
.topbar h2 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.login-copy {
  color: var(--text-soft);
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notice {
  margin: 20px 0;
  padding: 13px 14px;
  background: rgba(66, 216, 143, 0.1);
  border: 1px solid rgba(66, 216, 143, 0.28);
  border-radius: var(--radius);
  color: #c8f8df;
}

.notice.danger {
  background: var(--danger-bg);
  border-color: rgba(251, 113, 133, 0.34);
  color: #ffd2da;
}

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.primary-action {
  width: 100%;
  border: 1px solid rgba(124, 248, 183, 0.62);
  background: linear-gradient(180deg, #7cf8b7, #35c981);
  color: #04130d;
  box-shadow: 0 12px 34px rgba(66, 216, 143, 0.18);
}

.primary-action:hover {
  background: linear-gradient(180deg, #9effc8, #42d88f);
}

.primary-action.disabled,
.primary-action:disabled,
.secondary-action:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.secondary-action:hover,
.ghost-action:hover {
  border-color: rgba(124, 248, 183, 0.5);
  background: rgba(66, 216, 143, 0.08);
  color: var(--text);
}

.ghost-action {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  background: rgba(10, 14, 20, 0.92);
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}

.sidebar h1 {
  max-width: 12ch;
  font-size: 30px;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.sidebar nav a {
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-soft);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.sidebar nav a:hover {
  background: rgba(66, 216, 143, 0.08);
  border-color: rgba(66, 216, 143, 0.24);
  color: var(--text);
}

.workspace {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018)), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.18);
}

.metric::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.metric {
  min-height: 112px;
  padding: 18px;
}

.metric span,
.panel-heading span,
th,
.activity-meta {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel h3 {
  font-size: 18px;
  letter-spacing: -0.01em;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 750;
}

.checkbox-line {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1016;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: #566579;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 248, 183, 0.72);
  box-shadow: 0 0 0 4px rgba(66, 216, 143, 0.1);
  background: #0d141c;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--text-soft);
}

td strong,
.activity-item strong {
  color: var(--text);
}

small {
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(124, 248, 183, 0.22);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(66, 216, 143, 0.08);
  color: #c8f8df;
  font-size: 12px;
  font-weight: 850;
}

.badge.ok {
  background: rgba(66, 216, 143, 0.14);
  border-color: rgba(66, 216, 143, 0.38);
  color: #9effc8;
}

.badge.warn {
  background: var(--warning-bg);
  border-color: rgba(246, 197, 111, 0.32);
  color: #ffe4ad;
}

.badge.danger {
  background: var(--danger-bg);
  border-color: rgba(251, 113, 133, 0.32);
  color: #ffd2da;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.activity-item span:not(.activity-meta) {
  color: var(--text-soft);
}

.empty {
  padding: 18px 0;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: no-preference) {
  .metric,
  .panel,
  .login-panel {
    animation: surface-in 420ms ease both;
  }

  @keyframes surface-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1120px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    gap: 20px;
  }

  .sidebar h1 {
    max-width: none;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 22px;
  }

  .metrics-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 20px;
  }

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

@media (max-width: 560px) {
  .login-shell {
    padding: 14px;
  }

  .login-panel,
  .panel,
  .metric {
    padding: 18px;
  }

  .sidebar,
  .workspace {
    padding: 16px;
  }

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

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