@charset "utf-8";

:root {
  color-scheme: light;
  --bg-0: #f4f6fa;
  --bg-1: #e9eef6;
  --surface: #ffffff;
  --surface-2: #f0f4f8;
  --ink: #111827;
  --muted: #4b5563;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-3: #0f172a;
  --danger: #b91c1c;
  --ring: rgba(37, 99, 235, 0.22);
  --shadow-lg: 0 30px 60px -40px rgba(15, 23, 42, 0.45);
  --shadow-md: 0 24px 40px -30px rgba(15, 23, 42, 0.4);
  --shadow-sm: 0 12px 24px -20px rgba(15, 23, 42, 0.3);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --gap-xl: 28px;
  --gap-lg: 20px;
  --gap-md: 16px;
  --gap-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 45%),
    radial-gradient(circle at 15% 25%, rgba(15, 23, 42, 0.12), transparent 50%),
    linear-gradient(140deg, var(--bg-0), var(--bg-1));
  line-height: 1.5;
}

main {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

h1,
h2,
h3,
.display {
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  letter-spacing: -0.02em;
}

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

.brand-logo-content {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 1rem;
}

.brand-logo-content .brand-logo {
  height: 48px;
}

.link-prominent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent-2);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  box-shadow: 0 10px 20px -18px rgba(37, 99, 235, 0.6);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.link-prominent:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.18);
  box-shadow: 0 16px 26px -18px rgba(37, 99, 235, 0.7);
}

.page {
  min-height: 100vh;
  padding: 36px 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page.align-top {
  align-items: flex-start;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.panel {
  width: min(920px, 92vw);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 3.5vw, 40px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap-lg);
}

.panel header {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--accent-3);
}

.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid rgba(180, 180, 180, 0.2);
}

.card.soft {
  background: var(--surface-2);
}

.stack {
  display: grid;
  gap: var(--gap-md);
}

.stack.tight {
  gap: var(--gap-sm);
}

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

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 30px -18px rgba(37, 99, 235, 0.6);
}

.btn.secondary {
  background: var(--surface-2);
  color: var(--ink);
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(15, 26, 28, 0.2);
  color: var(--ink);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 26, 28, 0.12);
  background: #fff;
  font-size: 0.92rem;
  font-family: inherit;
}

.input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px var(--ring);
}

.field {
  display: grid;
  gap: var(--gap-sm);
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.helper {
  font-size: 0.85rem;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-2);
  font-weight: 600;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-md);
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.profile-details {
  display: grid;
  gap: 2px;
}

.profile-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.profile-email {
  font-size: 0.8rem;
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
}

.nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  margin-bottom: 4px;
  background: var(--surface);
  padding: 6px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.nav-tabs button {
  background: transparent;
  border: none;
  padding: 12px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  width: 128px;
}

.nav-tabs button.active {
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0 12px 20px -16px rgba(29, 78, 216, 0.6);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table thead th {
  text-align: left;
  padding: 10px 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.table tbody tr {
  border-top: 1px solid rgba(15, 26, 28, 0.08);
}

.table tbody td {
  padding: 12px 8px;
  vertical-align: top;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.08);
  color: var(--accent-3);
}

.badge.success {
  background: rgba(29, 78, 216, 0.12);
  color: var(--accent-2);
}

.badge.danger {
  background: rgba(185, 28, 28, 0.12);
  color: var(--danger);
}

.split {
  display: grid;
  gap: var(--gap-lg);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-block-end: 20px;
}

.section {
  margin-top: 20px;
  display: grid;
  gap: var(--gap-lg);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
}

.stat-grid {
  display: grid;
  gap: var(--gap-md);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 16px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid rgba(15, 26, 28, 0.08);
  display: grid;
  gap: 6px;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-3);
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.chart-grid {
  display: grid;
  gap: var(--gap-lg);
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.chart-span-2 {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-span-2 {
    grid-column: auto;
  }
}

.chart {
  min-height: 180px;
  display: grid;
  gap: 12px;
}

.chart canvas {
  width: 100% !important;
  height: 180px !important;
}

.chart-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.chart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 21, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

body.chart-expanded {
  overflow: hidden;
}

.chart-card.is-expanded {
  position: fixed;
  inset: 24px;
  z-index: 50;
  margin: 0;
  width: auto;
  max-width: none;
  height: auto;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(9, 14, 21, 0.55);
}

.chart-card.is-expanded .chart {
  min-height: 0;
  flex: 1 1 auto;
}

.chart-card.is-expanded .chart canvas {
  height: 100% !important;
}

.chart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

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

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  font-size: 0.85rem;
  color: var(--accent-3);
  font-weight: 600;
}

.bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 26, 28, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--bar, 0%);
  background: var(--accent);
  border-radius: 999px;
}

.bar-value {
  font-size: 0.78rem;
  color: var(--muted);
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chart-empty {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(15, 26, 28, 0.2);
  color: var(--muted);
  text-align: center;
}

.chart-subtitle {
  margin: 12px 0 6px;
  font-size: 0.95rem;
  color: var(--accent-3);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 20, 22, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal .card {
  width: min(520px, 92vw);
  animation: floatIn 0.3s ease;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 4;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-tone='error'] {
  background: var(--danger);
}

.toast[data-tone='success'] {
  background: var(--accent-2);
}

.fade-in {
  animation: fadeUp 0.45s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .panel {
    grid-template-columns: 1fr;
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    display: block;
    padding: 12px 0;
  }

  .table tbody td {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
  }

  .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
  }

  .profile-card {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 1366px) {
  .page {
    padding: 28px 0 40px;
  }

  .container {
    width: min(1040px, 94vw);
  }

  .panel {
    width: min(860px, 94vw);
  }

  .card {
    padding: 18px;
  }
}

.p-0 {
  padding: 0;
}

.m-0 {
  margin: 0;
}

.code-block {
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--bg-1);
  border-radius: var(--radius-md);
}
