:root {
  --bf-primary: #1d665d;
  --bf-primary-hover: #175048;
  --bf-accent: #b3d98c;
  --bf-accent-soft: #e6f1d4;
  --bf-secondary: #5b6663;
  --bf-text: #333333;
  --bf-muted: #7a8380;
  --bf-bg: #ffffff;
  --bf-bg-off: #fafafa;
  --bf-bg-tint: #f5f7f4;
  --bf-border: #e5e7eb;
  --bf-border-soft: #eef0ee;
}

html, body { height: 100%; }
body {
  font-family: 'Epilogue', system-ui, sans-serif;
  color: var(--bf-text);
  background: var(--bf-bg-off);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.lc { text-transform: lowercase; }

/* Shadows */
.bf-shadow-sm { box-shadow: 0 1px 2px rgba(17,24,28,0.04), 0 1px 1px rgba(17,24,28,0.03); }
.bf-shadow-md { box-shadow: 0 2px 6px rgba(17,24,28,0.05), 0 8px 24px -12px rgba(17,24,28,0.08); }
.bf-shadow-glow { box-shadow: 0 0 0 1px rgba(29,102,93,0.08), 0 10px 30px -12px rgba(29,102,93,0.25); }

/* Focus ring */
.bf-ring-focus:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29,102,93,0.18);
  border-color: var(--bf-primary) !important;
}

/* Transitions */
.transition-fast { transition: all 150ms ease-out; }
.transition-med { transition: all 200ms ease-out; }

/* Row hover */
.row-hover:hover { background: #f8faf7; }

/* Pulse animation */
@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.pulse-dot { animation: softPulse 1.6s ease-in-out infinite; }

/* Modal animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.fade-in { animation: fadeIn 180ms ease-out; }
.scale-in { animation: scaleIn 200ms ease-out; }

/* Custom scrollbar */
.thin-scroll::-webkit-scrollbar { height: 8px; width: 8px; }
.thin-scroll::-webkit-scrollbar-thumb { background: #d9ddda; border-radius: 999px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }

/* Input base */
.bf-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--bf-border);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--bf-text);
  transition: all 150ms ease-out;
}
.bf-input:hover { border-color: #d3d9d6; }
.bf-input::placeholder { color: #9aa2a0; }

/* Buttons */
.btn-primary {
  background: var(--bf-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  transition: all 150ms ease-out;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  border: none;
  cursor: pointer;
}
.btn-primary:hover:not(:disabled) { background: var(--bf-primary-hover); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { background: #c8cfcc; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--bf-text);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  transition: all 150ms ease-out;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--bf-border);
  cursor: pointer;
}
.btn-ghost:hover { background: var(--bf-bg-off); border-color: #d3d9d6; }

.btn-text {
  color: var(--bf-primary);
  font-weight: 500;
  font-size: 14px;
  transition: all 150ms ease-out;
  background: none;
  border: none;
  cursor: pointer;
}
.btn-text:hover { color: var(--bf-primary-hover); text-decoration: underline; text-underline-offset: 3px; }

.btn-danger {
  background: #8a3a3a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  transition: all 150ms ease-out;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
}
.btn-danger:hover { background: #6e2e2e; }

/* Sidebar nav item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--bf-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 150ms ease-out;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  text-decoration: none;
}
.nav-item:hover { background: #f2f4f1; color: var(--bf-text); }
.nav-item.active { background: #edf3e7; color: var(--bf-primary); }
.nav-item.active svg { color: var(--bf-primary); }

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.pill-ok { background: #ecf4e2; color: #4a7a2e; }
.pill-warn { background: #fef3e3; color: #9a6320; }
.pill-open { background: #eef1ef; color: var(--bf-secondary); }
.pill-off { background: transparent; color: #9aa2a0; border: 1px dashed #d9ddda; }
.pill-done { background: var(--bf-accent-soft); color: var(--bf-primary); }
.pill-reject { background: #fbe9e9; color: #8a3a3a; }

/* Table */
table.bf-table { width: 100%; border-collapse: separate; border-spacing: 0; }
table.bf-table th {
  text-align: left;
  font-weight: 500;
  color: var(--bf-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bf-border);
  background: var(--bf-bg-off);
}
table.bf-table td {
  padding: 14px;
  border-bottom: 1px solid var(--bf-border-soft);
  font-size: 14px;
  color: var(--bf-text);
  vertical-align: middle;
}
table.bf-table tr.today td { background: #f5faf0; }
table.bf-table tr.today td:first-child { border-left: 2px solid var(--bf-primary); padding-left: 12px; }
table.bf-table tr.off td { color: #a0a7a4; }
table.bf-table tr:last-child td { border-bottom: none; }

/* Checkbox */
.bf-check {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #c8cfcc;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 150ms ease-out;
}
.bf-check:checked {
  background: var(--bf-primary);
  border-color: var(--bf-primary);
}
.bf-check:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Toggle */
.bf-toggle {
  position: relative;
  width: 36px; height: 20px;
  background: #d9ddda;
  border-radius: 999px;
  cursor: pointer;
  transition: all 150ms ease-out;
  display: inline-block;
}
.bf-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: all 180ms ease-out;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.bf-toggle.on { background: var(--bf-primary); }
.bf-toggle.on::after { left: 18px; }

/* Step dots */
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: #d9ddda; display: inline-block; }
.step-dot.done { background: var(--bf-primary); }
.step-dot.active { background: var(--bf-primary); box-shadow: 0 0 0 4px rgba(29,102,93,0.15); }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
}

/* Flash messages */
.flash-msg {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.flash-success { background: var(--bf-accent-soft); color: var(--bf-primary); border: 1px solid #cfe3b0; }
.flash-error { background: #fbe9e9; color: #8a3a3a; border: 1px solid #e3c1c1; }
.flash-info { background: #eef1ef; color: var(--bf-secondary); border: 1px solid var(--bf-border); }

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17,24,28,0.35);
  backdrop-filter: blur(4px);
}
.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 100%;
  box-shadow: 0 2px 6px rgba(17,24,28,0.05), 0 8px 24px -12px rgba(17,24,28,0.08);
}

/* Avatar */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  flex-shrink: 0;
}

/* Spin animation for loading */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 0.8s linear infinite; }

/* Editable cell */
.editable-cell {
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 6px;
  transition: all 150ms ease-out;
}
.editable-cell:hover { background: #edf3e7; }
