/* ─────────────────────────────────────────────────────────────────────────────
   Werkhaus Shell CSS
   Layout grid, nav components, cards, forms, and all shared UI primitives.
   Imports tokens.css. Never define colors directly — always use tokens.
───────────────────────────────────────────────────────────────────────────── */

@import url('./tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  height: 100%;
  background: var(--wk-bg-base);
  color: var(--wk-text);
  font-family: var(--wk-font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Shell root — full viewport grid ────────────────────────────────────── */
#shell-root {
  display: grid;
  grid-template-columns: var(--wk-rail-w) var(--wk-nav-w) 1fr;
  grid-template-rows: var(--wk-topbar-h) 1fr var(--wk-footer-h);
  height: 100vh;
  overflow: hidden;
}

/* Sidebar variants controlled by data-sidebar on #shell-root */
#shell-root[data-sidebar="right"] {
  grid-template-columns: var(--wk-rail-w) var(--wk-nav-w) 1fr var(--wk-sidebar-w);
}
#shell-root[data-sidebar="wide"] {
  grid-template-columns: var(--wk-rail-w) var(--wk-nav-w) 1fr var(--wk-sidebar-wide);
}
#shell-root[data-sidebar="both"] {
  grid-template-columns: var(--wk-rail-w) var(--wk-nav-w) 1fr var(--wk-sidebar-wide) 200px;
}
#shell-root[data-sidebar="none"] {
  grid-template-columns: var(--wk-rail-w) var(--wk-nav-w) 1fr;
}

/* ── Icon rail ───────────────────────────────────────────────────────────── */
#shell-rail {
  grid-row: 1 / -1;
  grid-column: 1;
  background: var(--wk-bg-base);
  border-right: 1px solid var(--wk-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 2px;
  z-index: 30;
}

.rail-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--wk-r-md);
  background: var(--wk-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wk-font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  flex-shrink: 0;
  text-decoration: none;
}

.rail-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--wk-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--wk-duration) var(--wk-ease),
              color var(--wk-duration) var(--wk-ease);
  color: var(--wk-text-3);
  border: none;
  background: none;
  position: relative;
  text-decoration: none;
}
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover { background: var(--wk-bg-3); color: var(--wk-text); }
.rail-btn.active {
  background: var(--wk-accent-dim);
  color: var(--wk-accent);
}
.rail-btn .rail-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wk-green);
  border: 1.5px solid var(--wk-bg-base);
}
.rail-tooltip {
  position: absolute;
  left: 44px;
  background: var(--wk-bg-2);
  border: 1px solid var(--wk-border);
  border-radius: var(--wk-r-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--wk-text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 100;
}
.rail-btn:hover .rail-tooltip { opacity: 1; }

.rail-spacer { flex: 1; }
.rail-divider {
  width: 20px;
  height: 1px;
  background: var(--wk-border);
  margin: 4px 0;
}

/* ── Nav panel ───────────────────────────────────────────────────────────── */
#shell-nav {
  grid-row: 1 / -1;
  grid-column: 2;
  background: var(--wk-bg-1);
  border-right: 1px solid var(--wk-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}

.nav-header {
  height: var(--wk-topbar-h);
  display: flex;
  align-items: center;
  padding: 0 var(--wk-space-4);
  border-bottom: 1px solid var(--wk-border);
  flex-shrink: 0;
}
.nav-header-title {
  font-family: var(--wk-font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--wk-text);
}

.nav-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--wk-space-2) var(--wk-space-2);
  scrollbar-width: none;
}
.nav-body::-webkit-scrollbar { display: none; }

.nav-section-label {
  padding: var(--wk-space-4) var(--wk-space-3) var(--wk-space-1);
  font-size: 10px;
  color: var(--wk-text-3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--wk-space-3);
  border-radius: var(--wk-r-md);
  cursor: pointer;
  transition: background var(--wk-duration) var(--wk-ease),
              color var(--wk-duration) var(--wk-ease);
  color: var(--wk-text-2);
  font-size: 13px;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--wk-bg-3); color: var(--wk-text); }
.nav-item.active {
  background: var(--wk-accent-dim);
  color: var(--wk-accent);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--wk-accent);
  border-radius: 0 2px 2px 0;
}
.nav-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-item-icon svg { width: 16px; height: 16px; }
.nav-item-label { flex: 1; }
.nav-badge {
  padding: 1px 7px;
  border-radius: var(--wk-r-pill);
  font-size: 10px;
  font-family: var(--wk-font-mono);
  font-weight: 500;
  background: var(--wk-accent-dim);
  color: var(--wk-accent);
  flex-shrink: 0;
}
.nav-badge.green { background: var(--wk-green-dim); color: var(--wk-green); }
.nav-badge.amber { background: var(--wk-amber-dim); color: var(--wk-amber); }

.nav-footer {
  padding: var(--wk-space-3);
  border-top: 1px solid var(--wk-border);
  flex-shrink: 0;
}
.nav-user-chip {
  display: flex;
  align-items: center;
  gap: var(--wk-space-2);
  padding: 9px var(--wk-space-3);
  border-radius: var(--wk-r-md);
  background: var(--wk-bg-2);
  cursor: pointer;
  transition: background var(--wk-duration) var(--wk-ease);
}
.nav-user-chip:hover { background: var(--wk-bg-3); }
.nav-user-av {
  width: 28px;
  height: 28px;
  border-radius: var(--wk-r-sm);
  background: var(--wk-accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--wk-accent);
  flex-shrink: 0;
  overflow: hidden;
}
.nav-user-av canvas { display: block; }
.nav-user-name { font-size: 13px; font-weight: 500; color: var(--wk-text); }
.nav-user-role { font-size: 10px; color: var(--wk-text-2); }
.nav-xp-bar {
  height: 3px;
  background: var(--wk-border);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.nav-xp-fill {
  height: 100%;
  background: var(--wk-accent);
  border-radius: 2px;
  transition: width 0.6s var(--wk-ease);
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
#shell-topbar {
  grid-column: 3 / -1;
  grid-row: 1;
  background: var(--wk-bg-1);
  border-bottom: 1px solid var(--wk-border);
  display: flex;
  align-items: center;
  padding: 0 var(--wk-space-5);
  gap: var(--wk-space-3);
  z-index: 10;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--wk-space-2);
  font-size: 13px;
}
.topbar-crumb { color: var(--wk-text-2); }
.topbar-crumb-sep { color: var(--wk-text-3); font-size: 11px; }
.topbar-crumb.current { color: var(--wk-text); font-weight: 500; }

.topbar-spacer { flex: 1; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: var(--wk-space-2);
  background: var(--wk-bg-2);
  border: 1px solid var(--wk-border);
  border-radius: var(--wk-r-md);
  padding: 6px var(--wk-space-3);
  width: 200px;
  font-size: 13px;
  color: var(--wk-text-3);
  cursor: text;
  transition: border-color var(--wk-duration);
}
.topbar-search:focus-within {
  border-color: var(--wk-border-focus);
  color: var(--wk-text);
}
.topbar-search input {
  border: none;
  background: none;
  outline: none;
  color: var(--wk-text);
  font-family: var(--wk-font-body);
  font-size: 13px;
  width: 100%;
}
.topbar-search input::placeholder { color: var(--wk-text-3); }

.topbar-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--wk-r-md);
  border: 1px solid var(--wk-border);
  background: var(--wk-bg-2);
  color: var(--wk-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--wk-duration), color var(--wk-duration);
  flex-shrink: 0;
}
.topbar-icon-btn svg { width: 16px; height: 16px; }
.topbar-icon-btn:hover { background: var(--wk-bg-3); color: var(--wk-text); }

.topbar-cta {
  padding: 7px var(--wk-space-4);
  border-radius: var(--wk-r-md);
  background: var(--wk-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity var(--wk-duration);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.topbar-cta:hover { opacity: 0.88; }
.topbar-cta svg { width: 14px; height: 14px; }

.topbar-theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--wk-r-md);
  border: 1px solid var(--wk-border);
  background: var(--wk-bg-2);
  color: var(--wk-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
}

/* ── Content area ────────────────────────────────────────────────────────── */
#shell-content {
  grid-column: 3;
  grid-row: 2;
  background: var(--wk-bg-base);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--wk-space-5);
  scrollbar-width: thin;
  scrollbar-color: var(--wk-border) transparent;
}

/* ── Right sidebar ───────────────────────────────────────────────────────── */
#shell-sidebar {
  grid-column: 4;
  grid-row: 2;
  background: var(--wk-bg-1);
  border-left: 1px solid var(--wk-border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--wk-space-4);
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: var(--wk-space-5);
}
#shell-sidebar::-webkit-scrollbar { display: none; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
#shell-footer {
  grid-column: 3 / -1;
  grid-row: 3;
  background: var(--wk-bg-1);
  border-top: 1px solid var(--wk-border);
  display: flex;
  align-items: center;
  padding: 0 var(--wk-space-5);
  gap: var(--wk-space-4);
  font-size: 11px;
  color: var(--wk-text-3);
}
.footer-link {
  color: var(--wk-text-3);
  text-decoration: none;
  transition: color var(--wk-duration);
}
.footer-link:hover { color: var(--wk-text-2); }
.footer-spacer { flex: 1; }
.footer-status {
  display: flex;
  align-items: center;
  gap: var(--wk-space-1);
}
.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wk-green);
}
@keyframes wk-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.footer-dot.live { animation: wk-pulse 2s infinite; }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes wk-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wk-slide-in-left {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wk-slide-in-right {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wk-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes wk-count-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wk-shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

/* Page content animates in on load */
#shell-content { animation: wk-fade-in 0.25s var(--wk-ease) both; }
#shell-sidebar { animation: wk-slide-in-right 0.3s var(--wk-ease) 0.05s both; }
#shell-nav     { animation: wk-slide-in-left 0.25s var(--wk-ease) both; }

/* Stat cards stagger */
.wk-stat:nth-child(1) { animation: wk-fade-in 0.3s var(--wk-ease) 0.05s both; }
.wk-stat:nth-child(2) { animation: wk-fade-in 0.3s var(--wk-ease) 0.1s  both; }
.wk-stat:nth-child(3) { animation: wk-fade-in 0.3s var(--wk-ease) 0.15s both; }
.wk-stat:nth-child(4) { animation: wk-fade-in 0.3s var(--wk-ease) 0.2s  both; }

/* Cards animate in */
.wk-card { animation: wk-scale-in 0.25s var(--wk-ease) 0.15s both; }

/* Feed items stagger */
.wk-feed-item:nth-child(1) { animation: wk-fade-in 0.2s var(--wk-ease) 0.2s  both; }
.wk-feed-item:nth-child(2) { animation: wk-fade-in 0.2s var(--wk-ease) 0.25s both; }
.wk-feed-item:nth-child(3) { animation: wk-fade-in 0.2s var(--wk-ease) 0.3s  both; }
.wk-feed-item:nth-child(4) { animation: wk-fade-in 0.2s var(--wk-ease) 0.35s both; }
.wk-feed-item:nth-child(5) { animation: wk-fade-in 0.2s var(--wk-ease) 0.4s  both; }

/* Skeleton loading state */
.wk-skeleton {
  background: linear-gradient(90deg,
    var(--wk-bg-3) 25%, var(--wk-border-hover) 50%, var(--wk-bg-3) 75%);
  background-size: 200% 100%;
  animation: wk-shimmer 1.4s infinite;
  border-radius: var(--wk-r-sm);
  color: transparent;
  user-select: none;
}

/* Nav item transition — already set but reinforce */
.nav-item { transition: background 0.12s var(--wk-ease), color 0.12s var(--wk-ease), padding-left 0.12s var(--wk-ease); }
.nav-item:hover { padding-left: 16px; }
.nav-item.active { padding-left: 16px; }

/* Rail button hover scale */
.rail-btn { transition: background 0.12s, color 0.12s, transform 0.12s var(--wk-ease); }
.rail-btn:hover { transform: scale(1.08); }
.rail-btn.active { transform: scale(1); }

/* Card hover lift */
.wk-card { transition: border-color 0.15s var(--wk-ease), transform 0.15s var(--wk-ease); }
.wk-card:hover { border-color: var(--wk-border-hover); transform: translateY(-1px); }

/* Stat value count-up animation trigger */
.wk-stat-value.counting { animation: wk-count-up 0.4s var(--wk-ease) both; }

/* Mobile slide overlay nav */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--wk-bg-overlay);
  z-index: 40;
  display: none;
  animation: wk-fade-in 0.2s var(--wk-ease);
}
.nav-overlay.open { display: block; }
#shell-nav.slide-open {
  display: flex !important;
  position: fixed;
  left: var(--wk-rail-w);
  top: 0;
  bottom: 0;
  z-index: 45;
  animation: wk-slide-in-left 0.22s var(--wk-ease);
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
}

/* Scrollbar styling */
#shell-content::-webkit-scrollbar { width: 5px; }
#shell-content::-webkit-scrollbar-track { background: transparent; }
#shell-content::-webkit-scrollbar-thumb { background: var(--wk-border-hover); border-radius: 3px; }
#shell-content::-webkit-scrollbar-thumb:hover { background: var(--wk-text-3); }

/* Focus visible */
.rail-btn:focus-visible,
.nav-item:focus-visible,
.wk-btn:focus-visible,
.wk-input:focus-visible {
  outline: 2px solid var(--wk-border-focus);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHARED COMPONENT LIBRARY
   All reusable UI components. Use these everywhere — never rebuild.
═══════════════════════════════════════════════════════════════════════════ */

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.wk-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--wk-space-3);
  margin-bottom: var(--wk-space-5);
}
.wk-stat {
  background: var(--wk-bg-2);
  border: 1px solid var(--wk-border);
  border-radius: var(--wk-r-lg);
  padding: var(--wk-space-4);
}
.wk-stat-label {
  font-size: 10px;
  color: var(--wk-text-2);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--wk-space-2);
}
.wk-stat-value {
  font-family: var(--wk-font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--wk-text);
  line-height: 1;
  margin-bottom: var(--wk-space-1);
}
.wk-stat-delta { font-size: 12px; }
.wk-stat-delta.up   { color: var(--wk-green); }
.wk-stat-delta.down { color: var(--wk-red); }
.wk-stat-delta.neutral { color: var(--wk-text-2); }
.wk-stat.accent { border-color: rgba(91,138,245,.3); }
.wk-stat.accent .wk-stat-value { color: var(--wk-accent); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.wk-card {
  background: var(--wk-bg-2);
  border: 1px solid var(--wk-border);
  border-radius: var(--wk-r-lg);
  padding: var(--wk-space-4);
}
.wk-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--wk-space-3);
}
.wk-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--wk-text);
  letter-spacing: .2px;
}
.wk-card-action {
  font-size: 12px;
  color: var(--wk-accent);
  cursor: pointer;
  text-decoration: none;
}
.wk-card-action:hover { text-decoration: underline; }

/* ── Feed items ──────────────────────────────────────────────────────────── */
.wk-feed-item {
  display: flex;
  align-items: flex-start;
  gap: var(--wk-space-3);
  padding: var(--wk-space-3) 0;
  border-bottom: 1px solid var(--wk-border);
}
.wk-feed-item:last-child { border-bottom: none; }
.wk-feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.wk-feed-body { flex: 1; min-width: 0; }
.wk-feed-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--wk-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wk-feed-sub { font-size: 11px; color: var(--wk-text-2); }
.wk-feed-time {
  font-size: 10px;
  color: var(--wk-text-3);
  font-family: var(--wk-font-mono);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Tags / badges ───────────────────────────────────────────────────────── */
.wk-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--wk-r-sm);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.wk-tag.accent  { background: var(--wk-accent-dim);  color: var(--wk-accent);  }
.wk-tag.green   { background: var(--wk-green-dim);   color: var(--wk-green);   }
.wk-tag.amber   { background: var(--wk-amber-dim);   color: var(--wk-amber);   }
.wk-tag.red     { background: var(--wk-red-dim);     color: var(--wk-red);     }
.wk-tag.purple  { background: var(--wk-purple-dim);  color: var(--wk-purple);  }
.wk-tag.teal    { background: var(--wk-teal-dim);    color: var(--wk-teal);    }
.wk-tag.muted   { background: var(--wk-bg-3);        color: var(--wk-text-2);  }

/* ── Tier badges ─────────────────────────────────────────────────────────── */
.wk-tier {
  width: 28px;
  height: 28px;
  border-radius: var(--wk-r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wk-font-mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.wk-tier-A  { background: var(--wk-green-dim);  color: var(--wk-green);  }
.wk-tier-B  { background: var(--wk-accent-dim); color: var(--wk-accent); }
.wk-tier-C  { background: var(--wk-amber-dim);  color: var(--wk-amber);  }
.wk-tier-D  { background: var(--wk-bg-3);        color: var(--wk-text-2); }

/* ── Progress / bar ──────────────────────────────────────────────────────── */
.wk-bar-track {
  height: 4px;
  background: var(--wk-border);
  border-radius: 2px;
  overflow: hidden;
}
.wk-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s var(--wk-ease);
}
.wk-bar-fill.accent { background: var(--wk-accent); }
.wk-bar-fill.green  { background: var(--wk-green); }
.wk-bar-fill.amber  { background: var(--wk-amber); }
.wk-bar-fill.red    { background: var(--wk-red); }

/* ── Sidebar widgets ─────────────────────────────────────────────────────── */
.wk-widget { }
.wk-widget-title {
  font-size: 10px;
  color: var(--wk-text-3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: var(--wk-space-3);
  font-weight: 500;
}
.wk-widget-row {
  display: flex;
  align-items: center;
  gap: var(--wk-space-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--wk-border);
}
.wk-widget-row:last-child { border-bottom: none; }
.wk-widget-av {
  width: 26px;
  height: 26px;
  border-radius: var(--wk-r-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.wk-widget-label { font-size: 12px; color: var(--wk-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-widget-value { font-family: var(--wk-font-mono); font-size: 11px; color: var(--wk-text-2); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.wk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px var(--wk-space-4);
  border-radius: var(--wk-r-md);
  font-family: var(--wk-font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--wk-duration) var(--wk-ease);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.wk-btn svg { width: 14px; height: 14px; }
.wk-btn-primary { background: var(--wk-accent); color: #fff; }
.wk-btn-primary:hover { opacity: 0.88; }
.wk-btn-secondary { background: var(--wk-bg-3); border-color: var(--wk-border); color: var(--wk-text); }
.wk-btn-secondary:hover { background: var(--wk-border); }
.wk-btn-ghost { background: none; border-color: var(--wk-border); color: var(--wk-text-2); }
.wk-btn-ghost:hover { color: var(--wk-text); background: var(--wk-bg-3); }
.wk-btn-danger { background: var(--wk-red-dim); color: var(--wk-red); border-color: rgba(240,79,79,.2); }
.wk-btn-danger:hover { background: rgba(240,79,79,.2); }
.wk-btn-sm { padding: 5px var(--wk-space-3); font-size: 12px; }
.wk-btn-full { width: 100%; justify-content: center; }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.wk-input {
  width: 100%;
  padding: 9px var(--wk-space-3);
  background: var(--wk-bg-2);
  border: 1px solid var(--wk-border);
  border-radius: var(--wk-r-md);
  color: var(--wk-text);
  font-family: var(--wk-font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--wk-duration);
}
.wk-input:focus { border-color: var(--wk-border-focus); }
.wk-input::placeholder { color: var(--wk-text-3); }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.wk-divider {
  height: 1px;
  background: var(--wk-border);
  margin: var(--wk-space-4) 0;
}

/* ── Page header (within content area) ──────────────────────────────────── */
.wk-page-header { margin-bottom: var(--wk-space-5); }
.wk-page-title {
  font-family: var(--wk-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--wk-text);
  margin-bottom: 4px;
}
.wk-page-sub { font-size: 13px; color: var(--wk-text-2); }

/* ── Grid helpers ────────────────────────────────────────────────────────── */
.wk-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--wk-space-4); }
.wk-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--wk-space-4); }
.wk-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--wk-space-4); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  #shell-root,
  #shell-root[data-sidebar="right"],
  #shell-root[data-sidebar="wide"],
  #shell-root[data-sidebar="both"] {
    grid-template-columns: var(--wk-rail-w) 1fr;
    grid-template-rows: var(--wk-topbar-h) 1fr var(--wk-footer-h);
  }
  #shell-nav   { display: none; }
  #shell-topbar,
  #shell-content,
  #shell-footer { grid-column: 2 / -1; }
  #shell-sidebar {
    display: none;
  }
  #shell-content { grid-row: 2; }
  .wk-grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
  #shell-root,
  #shell-root[data-sidebar="right"],
  #shell-root[data-sidebar="wide"] {
    grid-template-columns: 1fr;
    grid-template-rows: var(--wk-topbar-h) 1fr 52px;
  }
  #shell-rail   { display: none; }
  #shell-topbar,
  #shell-content { grid-column: 1; }
  #shell-footer {
    grid-column: 1;
    justify-content: space-around;
    padding: 0;
  }
  #shell-content { padding: var(--wk-space-4); }
  .wk-grid-2,
  .wk-grid-3,
  .wk-grid-4 { grid-template-columns: minmax(0,1fr); }
  .topbar-search { display: none; }
}
