:root {
  /* Typography */
  --font-xs: clamp(12px, 0.60vw, 15px);
  --font-sm: clamp(14px, 0.72vw, 17px);
  --font-md: clamp(16px, 0.85vw, 20px);
  --font-lg: clamp(20px, 1.10vw, 28px);
  --font-xl: clamp(30px, 1.80vw, 44px);

  /* Spacing */
  --space-xs: clamp(6px, 0.35vw, 8px);
  --space-sm: clamp(8px, 0.50vw, 12px);
  --space-md: clamp(12px, 0.70vw, 16px);
  --space-lg: clamp(16px, 1vw, 24px);

  /* Cards */
  --card-width: clamp(260px, 14vw, 300px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: #0d1117;
  color: #e6edf3;
  font-family: -apple-system, "Segoe UI", "Inter", sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#board {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ── */
.header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;

  padding: var(--space-md) var(--space-lg);
  gap: var(--space-lg);

  background: #161b22;
  border-bottom: 1px solid #30363d;

  flex-shrink: 0;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.logo-image {
  height: clamp(28px, 2.4vw, 52px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-mark {
  width: clamp(28px, 2.4vw, 52px);
  height: clamp(28px, 2.4vw, 52px);
  background: #f0b429;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--font-md);
  color: #0d1117;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand-block {
}
.brand-name {
  font-size:var(--font-lg);
  font-weight:700;
  color: #fff;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size:var(--font-sm);
  color: #8b949e;
  margin-top: 1px;
}
.live-pill {
  display: flex;
  align-items: center;
  gap: 0.4vw;
  background: rgba(46, 160, 67, 0.15);
  border: 1px solid rgba(46, 160, 67, 0.4);
  border-radius: 100px;
  font-size:var(--font-sm);
  padding:4px 12px;
  color: #3fb950;
  font-weight: 600;
}
.live-dot {
  width: clamp(5px, 0.38vw, 8px);
  height: clamp(5px, 0.38vw, 8px);
  border-radius: 50%;
  background: #3fb950;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 4px rgba(63, 185, 80, 0);
  }
}
.header-right {
  display: grid;
  grid-auto-flow: column;
  justify-content: end;
  align-items: center;
  column-gap: 22px;
  min-width: 0;
}
.stat-pill {
  width:110px;
  text-align: center;
}
.stat-pill .val {
  font-size:var(--font-xl);
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.stat-pill .val.amber {
  color: #f0b429;
}
.stat-pill .val.green {
  color: #3fb950;
}
.stat-pill .val.red {
  color: #f85149;
}
.stat-pill .lbl {
  font-size: clamp(8px, 0.58vw, 12px);
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1px;
}
.stat-divider {
  width: 1px;
  height:40px;
  background: #30363d;
}
.clock-block {
  min-width:130px;
  text-align: right;
}
.clock-time {
  font-size:var(--font-lg);
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.clock-date {
  font-size:var(--font-sm);
  color: #8b949e;
  margin-top: 1px;
}

/* ── KANBAN COLUMNS ── */
.kanban {
  flex: 1;

  display: grid;
  gap: 0;

  overflow-x: auto;
  overflow-y: hidden;

  align-items: stretch;

  scrollbar-width: thin;
}

.lane {
  min-width:var(--card-width);
  width:var(--card-width);

  display: flex;
  flex-direction: column;

  overflow: hidden;

  border-right: 1px solid #21262d;

  position: relative;
}
.lane:last-child {
  border-right: none;
}

.lane-header {
  position: sticky;
  top: 0;
  z-index: 2;

  height:48px;
  min-height:48px;
  padding:8px 10px;
  border-bottom: 2px solid;

  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 2px solid var(--lane-color);
  background: color-mix(in srgb, var(--lane-color) 8%, transparent);
}
.lane-title {
  flex: 1;
  min-width: 0;

  font-size:var(--font-sm);
  line-height:1.2;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lane-color);
}
.lane-count {
  font-size:var(--font-xs);
  font-weight: 600;
  padding: 0.15vh 0.45vw;
  border-radius: 100px;
  color: var(--lane-color);
  background: color-mix(in srgb, var(--lane-color) 18%, transparent);
}

.lane-cards {
  flex: 1;

  overflow-y: auto;
  overflow-x: hidden;

  display: flex;
  flex-direction: column;
  
  padding:var(--space-sm);
  gap:var(--space-sm);

  scrollbar-width: thin;
}

.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 12px 14px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
}
.card::before {
  background: var(--lane-color);
}

.card-id {
  font-size:var(--font-sm);
  font-weight: 700;
  color: #f0b429;
  letter-spacing: 0.05em;
  margin-bottom: 0.2vh;
}
.card-customer {
  font-size:var(--font-md);
  line-height:1.35;
  font-weight: 600;
  color: #e6edf3;
  margin-bottom: 0.35vh;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3vh;
}
.card-next {
  font-size:var(--font-xs);
  color: #8b949e;
}
.card-next span {
  color: #c9d1d9;
}
.card-status {
  display: flex;
  align-items: center;
  font-size: clamp(8px, 0.42vw, 13px);
  padding:4px 8px;
  gap:6px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 4px;
}
.card-status .dot {
  width:6px;
  height:6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.s-ontrack {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
}
.s-ontrack .dot {
  background: #3fb950;
}
.s-delayed {
  background: rgba(240, 180, 41, 0.12);
  color: #f0b429;
}
.s-delayed .dot {
  background: #f0b429;
  animation: blink 1.2s step-start infinite;
}
.s-awaiting {
  background: rgba(110, 159, 209, 0.12);
  color: #6e9fd1;
}
.s-awaiting .dot {
  background: #6e9fd1;
}
.s-ready {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
}
.s-ready .dot {
  background: #3fb950;
}
.s-overdue {
  background: rgba(248, 81, 73, 0.12);
  color: #f85149;
}
.s-overdue .dot {
  background: #f85149;
  animation: blink 0.8s step-start infinite;
}

.card-due {
  font-size:var(--font-xs);
  color: #8b949e;
  margin-top: 0.2vh;
}
.card-due.amber {
  color: #f0b429;
  font-weight: 600;
}
.card-due.red {
  color: #f85149;
  font-weight: 600;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

/* overflow count pill */
.more-pill {
  position: absolute;

  left: 50%;
  bottom: 10px;

  transform: translateX(-50%);

  z-index: 5;

  pointer-events: none;

  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 999px;

  font-size:var(--font-xs);
  padding:8px 14px;

  opacity: 0;

  transition: 0.2s;
}

.more-pill.visible {
  opacity: 1;
}

/* ── TICKER ── */
.ticker {
  display: flex;
  align-items: center;
  gap: 1vw;
  padding:12px 24px;
  border-top: 1px solid #30363d;
  background: #161b22;
  flex-shrink: 0;
  overflow: hidden;
}
.ticker-badge {
  background: #f85149;
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  flex-shrink: 0;
  font-size:var(--font-sm);
  padding:4px 12px;
  letter-spacing: 0.08em;
}
.ticker-track {
  overflow: hidden;
  flex: 1;
}
.ticker-inner {
  white-space: nowrap;
  color: #8b949e;
  font-size:var(--font-sm);
  line-height:1.5;
  display: inline-block;
  will-change: transform;
}
.ticker-inner strong {
  color: #e6edf3;
}
