:root {
  color-scheme: dark;
  --bg: #0c1016;
  --bg-elevated: #131924;
  --card-bg: #1a2130;
  --card-bg-hover: #212a3d;
  --border: #2a3448;
  --text: #e7ecf5;
  --text-muted: #93a0b8;
  --accent: #c9a04e;
  --accent-soft: rgba(201, 160, 78, 0.15);
  --danger: #e5484d;
  --high: #f2994a;
  --normal: #4a9df2;
  --low: #6b7688;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: #14181f;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 15px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.last-updated {
  font-size: 12px;
  color: var(--text-muted);
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #14181f;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.refresh-btn:hover {
  filter: brightness(1.08);
}

.refresh-btn:active {
  transform: scale(0.97);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.refresh-icon {
  display: inline-block;
  font-size: 14px;
}

.refresh-btn.spinning .refresh-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.board {
  display: flex;
  gap: 18px;
  padding: 24px 28px;
  overflow-x: auto;
  align-items: flex-start;
  min-height: calc(100vh - 78px);
}

.loading, .error, .empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 20px 0;
}

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

.column {
  flex: 0 0 300px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 110px);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  padding: 2px 4px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-name {
  flex: 1;
  color: var(--text);
}

.status-count {
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.card:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent);
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.35;
}

.card-row {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.card-client {
  color: var(--accent);
  font-weight: 600;
}

.card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-priority.urgent { background: rgba(229, 72, 77, 0.18); color: var(--danger); }
.badge-priority.high { background: rgba(242, 153, 74, 0.18); color: var(--high); }
.badge-priority.normal { background: rgba(74, 157, 242, 0.18); color: var(--normal); }
.badge-priority.low { background: rgba(107, 118, 136, 0.25); color: var(--low); }
.badge-priority.none { background: rgba(107, 118, 136, 0.15); color: var(--text-muted); }

.badge-due {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-due.na {
  background: rgba(107, 118, 136, 0.15);
  color: var(--text-muted);
}

.card-list {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
