:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e5eaf3;
  --text: #1f2a44;
  --muted: #6b7280;
  --brand: #2563eb;
  --brand-soft: #eff6ff;
  --danger-soft: #fef2f2;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

.app {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 248px;
  background: #fff;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px;
  overflow-y: auto;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  margin: 4px 8px 18px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.nav-group-title {
  margin: 16px 10px 8px;
  color: #9ca3af;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 2px 4px;
  border-radius: 10px;
  font-size: 14px;
  color: #334155;
}

.nav-item:hover {
  background: #f8fafc;
}

.nav-item.active {
  background: var(--brand-soft);
  color: #1d4ed8;
  font-weight: 600;
}

.nav-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.badge {
  margin-left: auto;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  padding: 8px 12px;
  font-weight: 600;
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn.disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.main {
  flex: 1;
  min-width: 0;
}

.top-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}

.warning {
  margin: 14px 18px 0;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
  color: #991b1b;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 18px;
}

.page-head h1 {
  font-size: 22px;
  margin: 0;
}

.page-head .sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.filters {
  margin: 0 18px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

input,
select,
textarea {
  border: 1px solid #d1d9e6;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
  color: #334155;
}

.content {
  margin: 0 18px 18px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.kpi-title {
  font-size: 12px;
  color: var(--muted);
}

.kpi-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
}

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

.placeholder-chart {
  height: 180px;
  border: 1px dashed #cdd6e5;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 12px;
}

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

th,
td {
  border-bottom: 1px solid #edf1f7;
  padding: 10px 8px;
  text-align: left;
  font-size: 13px;
}

th {
  color: #6b7280;
  font-weight: 600;
}

.table-wrap {
  overflow: auto;
}

.session-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.play-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid #bfdbfe;
  color: var(--brand);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d5deeb;
  background: #fff;
  color: #475569;
  font-size: 13px;
}

.tab.active {
  background: var(--brand-soft);
  color: #1d4ed8;
  border-color: #bfdbfe;
  font-weight: 600;
}

.layout-replay {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 300px;
  gap: 12px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.timeline {
  position: relative;
  height: 40px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-top: 10px;
}

.marker {
  position: absolute;
  top: 7px;
  width: 8px;
  height: 24px;
  border-radius: 5px;
  background: #2563eb;
  opacity: 0.8;
}

.heatmap-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
}

.heatmap-stage {
  position: relative;
  min-height: 620px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
}

.heatmap-canvas {
  width: 100%;
  height: 100%;
}

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

.list {
  padding-left: 18px;
  margin: 0;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #e8efff, #f4f7fb 55%);
}

.login-card {
  width: min(420px, 92vw);
  border-radius: 16px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
}

.sidebar-toggle {
  display: none;
}

@media (max-width: 1260px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .layout-replay {
    grid-template-columns: 1fr;
  }
  .heatmap-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .sidebar {
    width: 86px;
  }
  .brand span,
  .nav-item .text,
  .nav-group-title,
  .btn.btn-side-label {
    display: none;
  }
  .badge {
    display: none;
  }
  .nav-item {
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 30;
    transition: left 0.2s;
  }
  .sidebar.open {
    left: 0;
    width: 248px;
  }
  .sidebar.open .brand span,
  .sidebar.open .nav-item .text,
  .sidebar.open .nav-group-title,
  .sidebar.open .btn.btn-side-label,
  .sidebar.open .badge {
    display: inline;
  }
  .sidebar-toggle {
    display: inline-flex;
  }
}
