@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Sora:wght@500;600;700;800&display=swap');

:root {
  --bg: #17191f;
  --bg-soft: #1d2028;
  --surface: #232731;
  --surface-2: #1e222c;
  --border: rgba(116, 122, 141, 0.28);
  --text: #eff2fb;
  --muted: #a8afc3;
  --accent: #dfff00;
  --accent-2: #c8d91a;
  --success: #7ee787;
  --danger: #ff304f;
  --warning: #7566ff;
  --shadow: none;
  --sidebar-bg: #1b1f28;
  --sidebar-nav: #d7dcf0;
  --sidebar-nav-hover: #ffffff;
  --sidebar-link-muted: #aeb4c8;
  --card-bg: #272c36;
  --input-bg: rgba(21, 24, 32, 0.95);
  --input-bg-focus: rgba(16, 19, 27, 1);
  --outline-btn-bg: rgba(44, 49, 61, 0.55);
  --toast-bg: rgba(31, 35, 44, 0.98);
  --bg-grad-1: none;
  --bg-grad-2: none;
  --bg-grad-3: #17191f;
  --font-body: "Roboto", "Segoe UI", sans-serif;
  --font-heading: "Sora", "Roboto", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: normal;
  background: var(--bg-grad-3);
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.2;
}

h1,
.h1 {
  font-size: clamp(1.95rem, 2.7vw, 2.45rem);
}

h2,
.h2 {
  font-size: clamp(1.5rem, 2.1vw, 1.95rem);
}

h3,
.h3 {
  font-size: clamp(1.3rem, 1.7vw, 1.65rem);
}

h5,
.h5 {
  font-size: 1.06rem;
}

.dashboard-main .container-fluid {
  max-width: 1360px;
  padding-inline: clamp(0.35rem, 1vw, 0.75rem);
}

a {
  color: inherit;
}

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

.dashboard-sidebar {
  width: 96px;
  flex-shrink: 0;
  padding: 18px 10px;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  justify-content: center;
  width: 100%;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: transparent;
  border: 0;
  color: #e8f34b;
  font-weight: 900;
  font-size: 1.42rem;
  display: grid;
  place-items: center;
  line-height: 1;
}

.sidebar-subtitle {
  display: none;
}

.dashboard-sidebar .nav-link {
  border-radius: 14px;
  color: var(--sidebar-nav);
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: 1px solid transparent;
}

.dashboard-sidebar .nav-link:hover {
  color: var(--sidebar-nav-hover);
  background: rgba(117, 102, 255, 0.14);
  border-color: rgba(117, 102, 255, 0.3);
}

.dashboard-sidebar .nav-link.active {
  color: #1a1d25;
  background: var(--accent);
  box-shadow: none;
  border-color: rgba(223, 255, 0, 0.65);
}

.sidebar-links .nav-link {
  color: var(--sidebar-link-muted);
}

.sidebar-links .nav-link:hover {
  color: #fff;
}

.sidebar-links {
  margin-top: auto !important;
  padding-top: 14px;
}

.sidebar-links .small-muted {
  display: none;
}

.nav-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.nav-label {
  display: none;
}

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

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 1.1rem !important;
}

.page-head .small-muted {
  margin-top: 0.35rem;
}

.content-card,
.metric-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 20px;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  display: none;
}

.metric-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: normal;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2vw, 1.92rem);
  line-height: 1.12;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: normal;
  color: var(--accent);
}

.metric-sub {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 6px;
}

.kpi-accent {
  color: var(--accent);
}

.small-muted {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 500;
}

.form-label {
  font-size: 0.78rem;
  letter-spacing: normal;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.table thead th {
  font-size: 0.74rem;
  letter-spacing: normal;
  text-transform: uppercase;
  font-weight: 600;
  color: #bfc5d8;
  border-bottom-width: 1px;
}

.table td {
  font-size: 0.92rem;
  vertical-align: middle;
}

.dashboard-main h6.small-muted.text-uppercase {
  font-size: 0.72rem;
  letter-spacing: normal;
  margin-bottom: 0.55rem;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-striped-color: var(--text);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
  --bs-table-hover-color: var(--text);
}

.form-control,
.form-select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
}

.form-control::placeholder {
  color: var(--muted);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(223, 255, 0, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(223, 255, 0, 0.16);
  background: var(--input-bg-focus);
  color: var(--text);
}

.btn-accent {
  background: var(--accent);
  border: 0;
  color: #1a1d25;
  font-weight: 800;
  border-radius: 14px;
  box-shadow: none;
}

.btn-accent:hover {
  color: #101217;
  filter: brightness(0.98);
}

.btn-outline-muted {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--outline-btn-bg);
  border-radius: 14px;
}

.btn-outline-muted:hover {
  color: #ffffff;
  border-color: rgba(223, 255, 0, 0.42);
  background: rgba(223, 255, 0, 0.12);
}

.badge-soft,
.badge-soft-muted,
.badge-soft-danger {
  border-radius: 999px;
  font-weight: 700;
  padding: 5px 9px;
  text-transform: uppercase;
  letter-spacing: normal;
  font-size: 0.72rem;
  line-height: 1;
}

.badge-soft {
  background: rgba(223, 255, 0, 0.2);
  border: 1px solid rgba(223, 255, 0, 0.55);
  color: #dfff00;
}

.badge-soft-muted {
  background: rgba(223, 255, 0, 0.16);
  border: 1px solid rgba(223, 255, 0, 0.45);
  color: #dfff00;
}

.badge-soft-danger {
  background: rgba(255, 48, 79, 0.18);
  border: 1px solid rgba(255, 48, 79, 0.55);
  color: #ff8ea1;
}

pre.codebox,
pre.codeboxEmbedding {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: #d8dded;
  padding: 10px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

pre.codeboxEmbedding {
  max-height: 300px;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.22rem;
}

pre.codeboxEmbedding.is-collapsed {
  max-height: calc(1.22rem * 3 + 0.2rem);
  overflow: hidden;
  white-space: pre-wrap;
  position: relative;
  cursor: pointer;
}

pre.codeboxEmbedding.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.1rem;
  background: linear-gradient(to bottom, rgba(21, 24, 32, 0), rgba(21, 24, 32, 0.95));
  pointer-events: none;
}

.date-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  width: fit-content;
  font-size: 0.78rem;
  line-height: 1;
}

.date-pill__label {
  color: #b8bfd4;
  text-transform: uppercase;
  font-weight: 600;
}

.date-pill__value {
  color: #d9deea;
  white-space: nowrap;
}

.date-pill--secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.toast {
  background: var(--toast-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
}

.status-indicator {
  font-size: 1.45rem;
  line-height: 1;
}

.status-healthy {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(223, 255, 0, 0.55);
}

.status-unhealthy {
  color: var(--danger);
  text-shadow: 0 0 8px rgba(255, 48, 79, 0.5);
}

.status-unknown {
  color: #98a0b6;
}

.status-checking {
  color: var(--accent-2);
  animation: pulse 1.4s ease-in-out infinite;
}

.status-text {
  font-size: 1.08rem;
  color: var(--text);
}

.pipeline-progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(116, 122, 141, 0.24);
  overflow: hidden;
}

.pipeline-progress > span {
  height: 100%;
  display: block;
  background: var(--accent);
}

.content-card {
  border-radius: 20px;
}

.table {
  border-collapse: collapse;
  border-spacing: 0;
}

.table > :not(caption) > * > * {
  background: transparent;
}

.table tbody tr {
  outline: none;
}

.dashboard-main .mb-3 {
  margin-bottom: 1.45rem !important;
}

.dashboard-main .mb-4 {
  margin-bottom: 2rem !important;
}

.dashboard-main .row {
  --bs-gutter-y: 1.2rem;
}

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

@media (max-width: 991.98px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .dashboard-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .dashboard-sidebar .nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    margin-top: 0 !important;
    gap: 8px !important;
  }

  .sidebar-links {
    margin-top: 0 !important;
    padding-top: 0;
    display: flex;
    gap: 8px;
  }

  .dashboard-sidebar .nav-link {
    width: 42px;
    height: 42px;
  }
}
