/* chalk.css v0.1.0 — low-fidelity UI primitives for humans and AI
 * https://github.com/okatarismet/chalk
 * MIT License
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: monospace;
  background: #fff;
  color: #111;
  font-size: 14px;
  padding: 24px;
  line-height: 1.4;
}

/* ─────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────── */

.wf-screen   { width: 100%; min-height: 100vh; display: flex; flex-direction: column; }
.wf-centered { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 16px; }
.wf-row      { display: flex; flex-direction: row; gap: 12px; align-items: center; }
.wf-col      { display: flex; flex-direction: column; gap: 12px; }
.wf-grid     { display: grid; gap: 16px; }
.wf-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.wf-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.wf-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.wf-spacer   { flex: 1; }
.wf-layout   { display: flex; flex-direction: row; flex: 1; }

/* ─────────────────────────────────────────
   SHELL — NAV, SIDEBAR, MAIN
   ───────────────────────────────────────── */

.wf-nav {
  width: 100%;
  border-bottom: 3px solid #111;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: #f5f5f5;
  flex-shrink: 0;
}
.wf-nav .logo      { font-weight: bold; font-size: 16px; letter-spacing: 1px; }
.wf-nav .nav-link  { text-decoration: underline; cursor: default; color: #111; }
.wf-nav .nav-link.active { font-weight: bold; text-decoration: none; border-bottom: 2px solid #111; }

.wf-topbar {
  width: 100%;
  border-bottom: 2px solid #111;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  flex-shrink: 0;
}

.wf-sidebar {
  width: 220px;
  border-right: 3px solid #111;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f5f5f5;
  flex-shrink: 0;
}
.wf-sidebar.wide { width: 280px; }
.wf-sidebar.narrow { width: 160px; }
.wf-sidebar .sidebar-item {
  padding: 6px 10px;
  border: 1px solid transparent;
  cursor: default;
}
.wf-sidebar .sidebar-item:hover,
.wf-sidebar .sidebar-item.active {
  border: 1px solid #111;
  background: #111;
  color: #fff;
}
.wf-sidebar .sidebar-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888;
  padding: 12px 10px 4px;
}

.wf-main {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
}

.wf-panel {
  border: 2px solid #111;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}
.wf-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid #111;
  padding-bottom: 12px;
  margin-bottom: 4px;
}

/* ─────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────── */

.wf-h1 { font-size: 28px; font-weight: bold; border-bottom: 2px solid #111; padding-bottom: 6px; }
.wf-h2 { font-size: 20px; font-weight: bold; }
.wf-h3 { font-size: 16px; font-weight: bold; }
.wf-h4 { font-size: 13px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }

.wf-label       { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #555; display: block; margin-bottom: 4px; }
.wf-text        { line-height: 1.6; color: #333; }
.wf-muted       { color: #888; font-size: 13px; }
.wf-placeholder { color: #bbb; font-style: italic; }
.wf-annotation  { font-size: 11px; color: #888; font-style: italic; border-left: 3px solid #ccc; padding-left: 8px; }
.wf-code        { font-family: monospace; background: #f0f0f0; border: 1px solid #ccc; padding: 2px 6px; font-size: 12px; }
.wf-link        { text-decoration: underline; cursor: default; }

/* ─────────────────────────────────────────
   BOX — generic primitive
   ───────────────────────────────────────── */

.wf-box {
  border: 2px solid #111;
  padding: 12px 16px;
  background: #fff;
}
.wf-box.shaded  { background: #e8e8e8; }
.wf-box.dashed  { border-style: dashed; border-color: #999; }
.wf-box.ghost   { border-color: #ccc; color: #aaa; }

/* ─────────────────────────────────────────
   CARD
   ───────────────────────────────────────── */

.wf-card {
  border: 2px solid #111;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}
.wf-card.compact { padding: 10px 12px; gap: 6px; }
.wf-card-title   { font-weight: bold; font-size: 15px; }
.wf-card-meta    { font-size: 11px; color: #888; }
.wf-card-footer  { border-top: 1px solid #ccc; padding-top: 10px; margin-top: 4px; }

/* Stat card */
.wf-stat {
  border: 2px solid #111;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wf-stat .stat-value { font-size: 32px; font-weight: bold; }
.wf-stat .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #666; }
.wf-stat .stat-delta { font-size: 12px; color: #555; }
.wf-stat .stat-delta.up   { color: #111; font-weight: bold; }
.wf-stat .stat-delta.down { color: #555; text-decoration: line-through; }

/* ─────────────────────────────────────────
   FORM ELEMENTS
   ───────────────────────────────────────── */

.wf-input {
  border: 2px solid #111;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 14px;
  background: #fff;
  width: 100%;
  outline: none;
}
.wf-input:focus  { outline: 3px solid #111; outline-offset: 1px; }
.wf-input.large  { padding: 12px 16px; font-size: 16px; }
.wf-input.error  { border-color: #111; border-style: dashed; }

.wf-textarea {
  border: 2px solid #111;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 14px;
  background: #fff;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  outline: none;
}

.wf-select {
  border: 2px solid #111;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 14px;
  background: #fff;
  width: 100%;
  appearance: none;
  cursor: default;
}

.wf-searchbar {
  display: flex;
  align-items: center;
  border: 2px solid #111;
  width: 100%;
}
.wf-searchbar input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-family: monospace;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.wf-searchbar .search-icon {
  padding: 10px 14px;
  border-left: 2px solid #111;
  background: #e8e8e8;
  font-size: 16px;
  flex-shrink: 0;
}

.wf-field { display: flex; flex-direction: column; gap: 4px; }
.wf-field-error { font-size: 11px; color: #111; font-style: italic; border-left: 2px solid #111; padding-left: 6px; }

.wf-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}
.wf-checkbox .box {
  width: 16px; height: 16px;
  border: 2px solid #111;
  background: #fff;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.wf-checkbox.checked .box { background: #111; color: #fff; }

.wf-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}
.wf-radio .dot {
  width: 16px; height: 16px;
  border: 2px solid #111;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.wf-radio.selected .dot::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #111;
  display: block;
}

.wf-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}
.wf-toggle .track {
  width: 36px; height: 18px;
  border: 2px solid #111;
  background: #e8e8e8;
  position: relative;
  border-radius: 9px;
}
.wf-toggle .track::after {
  content: '';
  width: 12px; height: 12px;
  border: 1px solid #111;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 1px; left: 1px;
}
.wf-toggle.on .track { background: #111; }
.wf-toggle.on .track::after { left: 19px; background: #fff; border-color: #fff; }

/* ─────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────── */

.wf-btn {
  border: 2px solid #111;
  padding: 8px 20px;
  font-family: monospace;
  font-size: 14px;
  background: #fff;
  cursor: default;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wf-btn.primary   { background: #111; color: #fff; }
.wf-btn.secondary { background: #e8e8e8; }
.wf-btn.ghost     { border-color: #ccc; color: #888; }
.wf-btn.danger    { border-style: dashed; }
.wf-btn.sm        { padding: 4px 12px; font-size: 12px; }
.wf-btn.lg        { padding: 12px 32px; font-size: 16px; }
.wf-btn.icon      { padding: 6px 10px; }
.wf-btn.full      { width: 100%; justify-content: center; }

.wf-btn-group { display: flex; }
.wf-btn-group .wf-btn { border-right-width: 1px; }
.wf-btn-group .wf-btn:last-child { border-right-width: 2px; }

/* ─────────────────────────────────────────
   BADGE / TAG / CHIP
   ───────────────────────────────────────── */

.wf-badge {
  border: 1px solid #111;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e8e8e8;
  display: inline-block;
  white-space: nowrap;
}
.wf-badge.dark    { background: #111; color: #fff; }
.wf-badge.outline { background: transparent; }
.wf-badge.pill    { border-radius: 99px; }
.wf-badge.dot::before {
  content: '●';
  margin-right: 4px;
  font-size: 8px;
}

/* ─────────────────────────────────────────
   TABLE
   ───────────────────────────────────────── */

.wf-table { border-collapse: collapse; width: 100%; }
.wf-table th, .wf-table td { border: 1px solid #111; padding: 8px 12px; text-align: left; }
.wf-table th { background: #e8e8e8; font-weight: bold; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.wf-table tr:nth-child(even) td { background: #f8f8f8; }
.wf-table.compact th,
.wf-table.compact td { padding: 4px 8px; font-size: 12px; }

/* ─────────────────────────────────────────
   TABS
   ───────────────────────────────────────── */

.wf-tabs { display: flex; flex-direction: column; }
.wf-tab-bar {
  display: flex;
  border-bottom: 2px solid #111;
  gap: 0;
}
.wf-tab-bar .tab {
  padding: 8px 20px;
  border: 2px solid transparent;
  border-bottom: none;
  cursor: default;
  font-size: 13px;
  margin-bottom: -2px;
}
.wf-tab-bar .tab.active {
  border: 2px solid #111;
  border-bottom: 2px solid #fff;
  background: #fff;
  font-weight: bold;
}
.wf-tab-bar .tab:not(.active) { color: #666; }
.wf-tab-content { border: 2px solid #111; border-top: none; padding: 20px; }

/* ─────────────────────────────────────────
   BREADCRUMB
   ───────────────────────────────────────── */

.wf-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.wf-breadcrumb .crumb { text-decoration: underline; cursor: default; color: #555; }
.wf-breadcrumb .crumb.current { text-decoration: none; font-weight: bold; color: #111; cursor: default; }
.wf-breadcrumb .sep { color: #bbb; }

/* ─────────────────────────────────────────
   PAGINATION
   ───────────────────────────────────────── */

.wf-pagination { display: flex; gap: 0; align-items: center; }
.wf-pagination .page {
  border: 1px solid #111;
  padding: 6px 12px;
  cursor: default;
  font-size: 13px;
  border-right-width: 0;
}
.wf-pagination .page:last-child { border-right-width: 1px; }
.wf-pagination .page.active { background: #111; color: #fff; font-weight: bold; }
.wf-pagination .page.disabled { color: #bbb; border-color: #ddd; }

/* ─────────────────────────────────────────
   ALERT / NOTIFICATION
   ───────────────────────────────────────── */

.wf-alert {
  border: 2px solid #111;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8f8f8;
}
.wf-alert .alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.wf-alert .alert-body { display: flex; flex-direction: column; gap: 2px; }
.wf-alert .alert-title { font-weight: bold; font-size: 13px; }
.wf-alert .alert-text  { font-size: 12px; color: #555; }
.wf-alert.info    { border-left: 4px solid #111; }
.wf-alert.warning { border-left: 4px solid #111; border-style: solid solid solid dashed; background: #f0f0f0; }
.wf-alert.error   { border-style: dashed; }
.wf-alert.success { background: #f0f0f0; }

/* ─────────────────────────────────────────
   PROGRESS
   ───────────────────────────────────────── */

.wf-progress { display: flex; flex-direction: column; gap: 4px; }
.wf-progress .track {
  height: 12px;
  border: 2px solid #111;
  background: #fff;
  position: relative;
}
.wf-progress .fill {
  height: 100%;
  background: #111;
}
.wf-progress .progress-label { font-size: 11px; color: #666; display: flex; justify-content: space-between; }

/* ─────────────────────────────────────────
   STEPPER / WIZARD
   ───────────────────────────────────────── */

.wf-stepper { display: flex; align-items: center; gap: 0; }
.wf-stepper .step { display: flex; align-items: center; gap: 0; }
.wf-stepper .step-circle {
  width: 28px; height: 28px;
  border: 2px solid #111;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: bold;
  background: #fff;
  flex-shrink: 0;
}
.wf-stepper .step.done .step-circle  { background: #111; color: #fff; }
.wf-stepper .step.active .step-circle { background: #e8e8e8; }
.wf-stepper .step-label { font-size: 11px; margin-left: 6px; white-space: nowrap; }
.wf-stepper .step-label .step-title { font-weight: bold; font-size: 13px; }
.wf-stepper .step-line {
  flex: 1;
  height: 2px;
  background: #111;
  min-width: 32px;
}
.wf-stepper .step-line.pending { background: #ccc; }

/* ─────────────────────────────────────────
   KANBAN
   ───────────────────────────────────────── */

.wf-kanban { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; }
.wf-kanban-col {
  width: 240px;
  flex-shrink: 0;
  border: 2px solid #111;
  display: flex;
  flex-direction: column;
}
.wf-kanban-col .col-header {
  padding: 10px 14px;
  border-bottom: 2px solid #111;
  background: #e8e8e8;
  font-weight: bold;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wf-kanban-col .col-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.wf-kanban-card {
  border: 1px solid #111;
  padding: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.wf-kanban-card .card-id { font-size: 10px; color: #888; }

/* ─────────────────────────────────────────
   TIMELINE
   ───────────────────────────────────────── */

.wf-timeline { display: flex; flex-direction: column; gap: 0; padding-left: 16px; }
.wf-timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 20px;
}
.wf-timeline-item:last-child { padding-bottom: 0; }
.wf-timeline-item::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: #ccc;
}
.wf-timeline-item:last-child::before { display: none; }
.wf-timeline-dot {
  width: 20px; height: 20px;
  border: 2px solid #111;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  margin-left: -26px;
  margin-top: 2px;
}
.wf-timeline-dot.filled { background: #111; }
.wf-timeline-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.wf-timeline-title { font-weight: bold; font-size: 13px; }
.wf-timeline-time  { font-size: 11px; color: #888; }
.wf-timeline-text  { font-size: 12px; color: #555; }

/* ─────────────────────────────────────────
   DROPDOWN PLACEHOLDER
   ───────────────────────────────────────── */

.wf-dropdown { position: relative; display: inline-block; width: 100%; }
.wf-dropdown-trigger {
  border: 2px solid #111;
  padding: 8px 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
  font-family: monospace;
  font-size: 14px;
}
.wf-dropdown-trigger .arrow { font-size: 10px; }
.wf-dropdown-menu {
  border: 2px solid #111;
  border-top: none;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.wf-dropdown-item {
  padding: 8px 14px;
  border-bottom: 1px solid #eee;
  cursor: default;
  font-size: 13px;
}
.wf-dropdown-item:last-child { border-bottom: none; }
.wf-dropdown-item.active { background: #111; color: #fff; }
.wf-dropdown-item.disabled { color: #bbb; }

/* ─────────────────────────────────────────
   AVATAR + AVATAR GROUP
   ───────────────────────────────────────── */

.wf-avatar {
  border: 2px solid #111;
  background: #e8e8e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  font-size: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  font-weight: bold;
}
.wf-avatar.sm { width: 24px; height: 24px; font-size: 9px; }
.wf-avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.wf-avatar.xl { width: 64px; height: 64px; font-size: 20px; }
.wf-avatar.square { border-radius: 0; }

.wf-avatar-group { display: flex; }
.wf-avatar-group .wf-avatar { margin-left: -8px; border: 2px solid #fff; }
.wf-avatar-group .wf-avatar:first-child { margin-left: 0; }

/* ─────────────────────────────────────────
   IMAGE / MEDIA PLACEHOLDER
   ───────────────────────────────────────── */

.wf-img {
  border: 2px solid #111;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 12px;
  min-height: 120px;
  position: relative;
}
.wf-img::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0,0,0,0.04) 10px,
    rgba(0,0,0,0.04) 20px
  );
}
.wf-img span { position: relative; z-index: 1; background: #e8e8e8; padding: 4px 8px; border: 1px solid #bbb; }

.wf-video {
  border: 2px solid #111;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  min-height: 200px;
}

/* ─────────────────────────────────────────
   MODAL
   ───────────────────────────────────────── */

.wf-modal-backdrop {
  background: rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.wf-modal {
  border: 3px solid #111;
  background: #fff;
  padding: 0;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  box-shadow: 6px 6px 0 #111;
}
.wf-modal-header {
  padding: 16px 20px;
  border-bottom: 2px solid #111;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f5f5;
}
.wf-modal-title  { font-size: 16px; font-weight: bold; }
.wf-modal-close  { font-size: 18px; cursor: default; color: #666; }
.wf-modal-body   { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.wf-modal-footer { padding: 14px 20px; border-top: 2px solid #111; display: flex; gap: 8px; justify-content: flex-end; background: #f5f5f5; }

/* ─────────────────────────────────────────
   TOAST / NOTIFICATION POPUP
   ───────────────────────────────────────── */

.wf-toast {
  border: 2px solid #111;
  background: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 4px 4px 0 #111;
  max-width: 320px;
  font-size: 13px;
}
.wf-toast.dark { background: #111; color: #fff; }

/* ─────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────── */

.wf-empty {
  border: 2px dashed #ccc;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #888;
  text-align: center;
}
.wf-empty .empty-icon { font-size: 32px; }
.wf-empty .empty-title { font-weight: bold; color: #555; font-size: 15px; }
.wf-empty .empty-text  { font-size: 13px; max-width: 280px; }

/* ─────────────────────────────────────────
   DIVIDER
   ───────────────────────────────────────── */

.wf-divider { border: none; border-top: 2px solid #111; width: 100%; margin: 8px 0; }
.wf-divider.light { border-color: #e0e0e0; }
.wf-divider.dashed { border-style: dashed; border-color: #ccc; }

/* ─────────────────────────────────────────
   UTILITY
   ───────────────────────────────────────── */

.wf-redline  { outline: 1px dashed red; }
.wf-blueline { outline: 1px dashed blue; }
.wf-note {
  background: #fffde8;
  border: 1px dashed #bbb;
  padding: 8px 12px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}
