:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #d9e0ea;
  --text: #152033;
  --muted: #5c6b82;
  --primary: #2f6fed;
  --primary-soft: #dfe9ff;
  --success: #1f8f5f;
  --success-soft: #d8f5e6;
  --warning: #b67612;
  --warning-soft: #fff1d6;
  --danger: #ba3f52;
  --danger-soft: #ffe1e7;
  --shadow: 0 10px 30px rgba(18, 38, 63, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 220px);
  color: var(--text);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

h1.slideIn {
  animation: slideInTitle 10s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.subtitle {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-link,
button,
select {
  border-radius: 12px;
}

.ghost-link,
button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 12px 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
}

button {
  cursor: pointer;
}

button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(217, 224, 234, 0.7);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.updated-pill-inline {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fbfcff;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
}

.action-group {
  align-self: end;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f4f9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.status-pill.good {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.message-bar {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid #f2deb3;
  font-weight: 600;
}

.hidden {
  display: none;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.kpi-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 170px repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.period-badge {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #e9eef8;
  border: 1px solid #d7e0ef;
}

.period-badge-text {
  font-size: 13px;
  font-weight: 700;
  color: #3b4f72;
  text-align: center;
  line-height: 1.35;
}

.recent-bugs-card {
  padding: 20px;
  position: sticky;
  top: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

.recent-bugs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-bug-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f7fb;
  border: 1px solid var(--border);
}

.recent-bug-key {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.recent-bug-summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-bug-meta {
  font-size: 12px;
  color: var(--muted);
}

.kpi-card {
  padding: 20px;
}

.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.kpi-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1;
}

.kpi-help {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
  gap: 16px;
  margin-top: 16px;
}

.chart-panel,
.table-panel {
  padding: 20px;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 48px;
  gap: 12px;
  align-items: center;
}

.bar-label,
.bar-value {
  font-size: 14px;
  font-weight: 600;
}

.bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #edf2fb;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #85a6ff, var(--primary));
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  background: #f5f7fb;
  color: var(--muted);
  text-align: center;
}

#throughputChart {
  min-height: 260px;
}

svg {
  width: 100%;
  height: auto;
  display: block;
}

.axis-label {
  fill: var(--muted);
  font-size: 12px;
}

.axis-line {
  stroke: #dde5f1;
  stroke-width: 1;
}

.grid-line {
  stroke: #edf2fb;
  stroke-width: 1;
}

.created-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resolved-line {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legend-row {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.created-dot {
  background: var(--primary);
}

.resolved-dot {
  background: var(--success);
}

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

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

th,
 td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2fb;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr:hover {
  background: #fbfcff;
}

.ticket-key {
  font-weight: 700;
  color: var(--primary);
}

.ticket-summary {
  min-width: 280px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eff4ff;
  color: var(--primary);
}

.age-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f5f9;
  font-weight: 700;
}

.danger-text {
  color: var(--danger);
}

.card-success {
  background: var(--success-soft);
  border-color: #b8e6d5;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(21, 32, 51, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-overlay.hidden {
  display: none;
}

.loading-content {
  text-align: center;
}

.bug-spinner {
  font-size: 80px;
  animation: bugBounce 0.6s infinite;
  margin-bottom: 20px;
}

@keyframes bugBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(15deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(-20px) rotate(-15deg);
  }
}

.loading-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--panel);
  margin: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes slideInTitle {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.team-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.team-tab {
  padding: 14px 32px;
  border-radius: 30px;
  border: none;
  background: #e8e8e8;
  color: #666;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.team-tab:hover {
  background: #d0d0d0;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.team-tab.active {
  background: linear-gradient(135deg, #3366ff 0%, #0052cc 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 24px rgba(51, 102, 255, 0.5);
  transform: translateY(-4px);
  font-weight: 700;
}

@media (max-width: 1024px) {
  .team-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
  }

  .team-tab {
    padding: 12px 24px;
    font-size: 14px;
  }
}

.slides-wrapper {
  min-height: 400px;
}

.slide {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}

.slide.active {
  display: block !important;
  opacity: 1;
  visibility: visible;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 18px;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .period-badge {
    min-height: 44px;
  }

  .hero {
    gap: 14px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions a {
    flex: 1;
    text-align: center;
  }

  .bar-row {
    grid-template-columns: 90px 1fr 40px;
  }
}
