/* kosh-dashboard.css — the animated dashboard in the home hero (markup in
   pages/home/body.html, charts drawn by assets/js/kosh-dashboard.js).

   It is laid out on a fixed 1125 x 715 design canvas, like the mockup it was
   built from, and scaled to whatever width its column gives it: .kd is a size
   container and every length below is N design pixels x --u, where
   --u = 100cqw / 1125. So it never overflows the column (or the page's side
   padding), scales without a transform, and its text stays crisp. */
.kd {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 1125 / 715;
}
.kd-stage {
  --u: calc(100cqw / 1125);
  position: absolute;
  inset: 0;
  font-family: inherit;
  font-size: calc(12 * var(--u));
  line-height: 1.5;
  letter-spacing: normal;
  color: #475569;
  text-transform: none;
  user-select: none;
  pointer-events: none;
}
.kd-stage * {
  box-sizing: border-box;
  margin: 0;
  font-family: inherit;
  letter-spacing: inherit;
}
.kd-stage .bi::before {
  vertical-align: -0.125em;
}

/* soft colour glows behind the cards */
.kd-glow {
  position: absolute;
  border-radius: 50%;
}
.kd-glow-blue {
  top: calc(45 * var(--u));
  left: calc(65 * var(--u));
  width: calc(350 * var(--u));
  height: calc(350 * var(--u));
  background: rgba(147, 197, 253, 0.3);
  filter: blur(calc(90 * var(--u)));
}
.kd-glow-purple {
  top: calc(325 * var(--u));
  left: calc(685 * var(--u));
  width: calc(400 * var(--u));
  height: calc(400 * var(--u));
  background: rgba(216, 180, 254, 0.3);
  filter: blur(calc(100 * var(--u)));
}
.kd-glow-green {
  top: calc(445 * var(--u));
  left: calc(315 * var(--u));
  width: calc(300 * var(--u));
  height: calc(300 * var(--u));
  background: rgba(167, 243, 208, 0.4);
  filter: blur(calc(80 * var(--u)));
}

/* the main board: sidebar + dashboard */
.kd-board {
  position: absolute;
  z-index: 1;
  top: 0;
  left: calc(185 * var(--u));
  display: grid;
  grid-template-columns: 1fr 3fr;
  width: calc(760 * var(--u));
  height: calc(550 * var(--u));
  overflow: hidden;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: calc(24 * var(--u));
  box-shadow:
    0 calc(25 * var(--u)) calc(45 * var(--u)) calc(-15 * var(--u)) rgba(30, 41, 59, 0.08),
    0 0 1px rgba(0, 0, 0, 0.08);
}
.kd-side {
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  padding: calc(32 * var(--u)) calc(20 * var(--u)) calc(20 * var(--u));
  background: rgba(248, 250, 252, 0.4);
  border-right: 1px solid #f1f5f9;
}
.kd-nav {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  padding: calc(10 * var(--u)) calc(14 * var(--u));
  border-radius: calc(12 * var(--u));
  font-size: calc(12 * var(--u));
  line-height: calc(16 * var(--u));
  font-weight: 500;
  color: #64748b;
}
.kd-nav i {
  font-size: calc(14 * var(--u));
}
.kd-nav-on {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}
.kd-main {
  padding: calc(24 * var(--u));
}
.kd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(20 * var(--u));
}
.kd-title {
  font-size: calc(20 * var(--u));
  line-height: calc(28 * var(--u));
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
}
.kd-subtitle {
  margin-top: calc(2 * var(--u));
  font-size: calc(11 * var(--u));
  color: #94a3b8;
}
.kd-pill {
  display: flex;
  align-items: center;
  gap: calc(4 * var(--u));
  padding: calc(4 * var(--u)) calc(10 * var(--u));
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: calc(12 * var(--u));
  font-size: calc(10 * var(--u));
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.kd-pill .bi-chevron-down {
  font-size: calc(8 * var(--u));
}
.kd-date {
  gap: calc(8 * var(--u));
  padding: calc(6 * var(--u)) calc(12 * var(--u));
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.8);
  font-size: calc(12 * var(--u));
  font-weight: 500;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.kd-date .bi-calendar3 {
  color: #94a3b8;
}
.kd-date .bi-chevron-down {
  margin-left: calc(4 * var(--u));
  font-size: calc(9 * var(--u));
  color: #94a3b8;
}

/* three stat cards */
.kd-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(12 * var(--u));
  margin-bottom: calc(24 * var(--u));
}
.kd-stat {
  padding: calc(12 * var(--u));
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid #f1f5f9;
  border-radius: calc(16 * var(--u));
}
.kd-stat-top {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  margin-bottom: calc(4 * var(--u));
  font-size: calc(11 * var(--u));
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}
.kd-ico {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  border-radius: calc(8 * var(--u));
  font-size: calc(10 * var(--u));
}
.kd-green {
  background: #d1fae5;
  color: #059669;
}
.kd-rose {
  background: #ffe4e6;
  color: #f43f5e;
}
.kd-blue {
  background: #dbeafe;
  color: #2563eb;
}
.kd-stat-val {
  font-size: calc(16 * var(--u));
  line-height: calc(24 * var(--u));
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.kd-stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(4 * var(--u));
  margin-top: calc(4 * var(--u));
  font-size: calc(9.5 * var(--u));
  color: #94a3b8;
  white-space: nowrap;
}
.kd-stat-foot b {
  font-weight: 700;
}
.kd-up-green {
  color: #10b981;
}
.kd-up-rose {
  color: #f43f5e;
}
.kd-up-blue {
  color: #3b82f6;
}
.kd-spark {
  display: block;
  flex: none;
  width: calc(40 * var(--u));
  height: calc(20 * var(--u));
}

/* transactions table */
.kd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(8 * var(--u));
}
.kd-h {
  font-size: calc(12 * var(--u));
  font-weight: 700;
  color: #1e293b;
}
.kd-h-lg {
  font-size: calc(14 * var(--u));
  line-height: calc(20 * var(--u));
}
.kd-link {
  display: flex;
  align-items: center;
  gap: calc(4 * var(--u));
  font-size: calc(11 * var(--u));
  font-weight: 700;
  color: #2563eb;
}
.kd-link i {
  font-size: calc(9 * var(--u));
}
.kd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(10.5 * var(--u));
}
/* the theme stripes tables, shades their header row, centres cells and gives
   each cell a shadow; none of that here */
.kd-table tr,
.kd-table th,
.kd-table td {
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
}
.kd-table th,
.kd-table td {
  /* the theme sets th, td { font-size: 10px } on small screens */
  font-size: inherit;
  padding: calc(8 * var(--u)) calc(6 * var(--u)) calc(8 * var(--u)) 0;
  border: 0;
  white-space: nowrap;
  vertical-align: middle;
}
.kd-table th {
  padding-top: 0;
  border-bottom: 1px solid #f1f5f9 !important;
  font-weight: 500;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
}
.kd-table td {
  font-weight: 500;
  color: #64748b;
}
.kd-table tbody tr + tr td {
  border-top: 1px solid #f1f5f9 !important;
}
.kd-table th:first-child,
.kd-table td:first-child {
  padding-left: calc(4 * var(--u));
}
.kd-table td:first-child {
  color: #94a3b8;
}
.kd-table th:last-child,
.kd-table td:last-child {
  padding-right: calc(4 * var(--u));
  text-align: right !important;
}
.kd-table td:last-child {
  color: #94a3b8;
}
.kd-table td:nth-child(3) {
  font-weight: 600;
  color: #1e293b;
}
.kd-table td i {
  margin-right: calc(4 * var(--u));
  font-size: calc(10 * var(--u));
}
.kd-t-blue {
  color: #2563eb !important;
}
.kd-t-green {
  color: #059669 !important;
}
.kd-t-rose {
  color: #f43f5e !important;
}
.kd-badge {
  display: inline-block;
  padding: calc(2 * var(--u)) calc(8 * var(--u));
  border-radius: 999px;
  font-size: calc(9 * var(--u));
  line-height: 1.4;
  font-weight: 700;
}
.kd-ok {
  background: #d1fae5;
  color: #059669;
}
.kd-wait {
  background: #ffedd5;
  color: #ea580c;
}
.kd-fail {
  background: #ffe4e6;
  color: #e11d48;
}

/* the three floating chart cards */
.kd-card {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(16 * var(--u));
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: calc(24 * var(--u));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.kd-card .kd-row {
  margin-bottom: 0;
}
.kd-chart {
  display: block;
  width: 100%;
}
.kd-card-waves {
  top: calc(250 * var(--u));
  left: 0;
  width: calc(335 * var(--u));
  height: calc(310 * var(--u));
  box-shadow:
    calc(-10 * var(--u)) calc(25 * var(--u)) calc(40 * var(--u)) calc(-10 * var(--u)) rgba(15, 23, 42, 0.12),
    0 0 1px rgba(0, 0, 0, 0.1);
}
.kd-card-waves .kd-chart {
  height: calc(200 * var(--u));
  margin-top: calc(4 * var(--u));
}
.kd-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(20 * var(--u));
  padding-top: calc(8 * var(--u));
  font-size: calc(10 * var(--u));
  font-weight: 600;
  color: #64748b;
}
.kd-legend span,
.kd-split span {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
}
.kd-dot {
  display: inline-block;
  flex: none;
  width: calc(8 * var(--u));
  height: calc(8 * var(--u));
  border-radius: 50%;
  background: var(--c);
}
.kd-card-donut {
  z-index: 3;
  top: calc(540 * var(--u));
  left: calc(390 * var(--u));
  flex-direction: row;
  align-items: center;
  width: calc(350 * var(--u));
  height: calc(175 * var(--u));
  box-shadow:
    0 calc(30 * var(--u)) calc(50 * var(--u)) calc(-12 * var(--u)) rgba(15, 23, 42, 0.15),
    0 0 1px rgba(0, 0, 0, 0.1);
}
.kd-donut {
  position: relative;
  flex: none;
  width: calc(130 * var(--u));
  height: calc(130 * var(--u));
}
.kd-donut .kd-chart {
  height: 100%;
}
.kd-donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}
.kd-donut-label span {
  font-size: calc(9 * var(--u));
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}
.kd-donut-label b {
  font-size: calc(12 * var(--u));
  font-weight: 700;
  color: #1e293b;
}
.kd-split {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: calc(6 * var(--u));
  padding-left: calc(16 * var(--u));
  font-size: calc(11 * var(--u));
}
.kd-split > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
}
.kd-split > div > span:first-child {
  font-weight: 500;
  color: #64748b;
}
.kd-split .kd-dot {
  width: calc(10 * var(--u));
  height: calc(10 * var(--u));
}
.kd-split b {
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}
.kd-split small {
  font-size: calc(10 * var(--u));
  color: #94a3b8;
}
.kd-card-turnover {
  top: calc(285 * var(--u));
  left: calc(845 * var(--u));
  width: calc(280 * var(--u));
  height: calc(270 * var(--u));
  box-shadow:
    calc(15 * var(--u)) calc(25 * var(--u)) calc(40 * var(--u)) calc(-10 * var(--u)) rgba(15, 23, 42, 0.12),
    0 0 1px rgba(0, 0, 0, 0.1);
}
.kd-card-turnover .kd-chart {
  height: calc(190 * var(--u));
  margin-top: calc(8 * var(--u));
}
