/* ============================================================
   BuildAI — Components
   Load order: tokens.css → components.css → layouts.css
   Naming: kebab-case flat. Format: [component]-[element]--[modifier]
   ============================================================ */

/* ===== BASE RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
svg { display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4,h5,h6 { margin: 0; }
p { margin: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast),
    box-shadow var(--duration-base),
    background var(--duration-base),
    border-color var(--duration-base);
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus-b); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Primary — gradient */
.btn-primary {
  background: var(--accent-gradient);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  font-size: var(--text-sm);
  height: 36px;
  padding: 0 var(--space-4);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { filter: brightness(0.9); }

/* Secondary — outline */
.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  height: 36px;
  padding: 0 var(--space-4);
}
.btn-secondary:hover { background: var(--color-surface-3); border-color: #3a3a3a; }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: none;
  font-size: var(--text-sm);
  height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { background: var(--color-surface-3); color: var(--color-text-primary); }

/* Danger */
.btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(255,51,102,0.25);
  font-size: var(--text-sm);
  height: 36px;
  padding: 0 var(--space-4);
}
.btn-danger:hover { background: rgba(255,51,102,0.15); }

/* Icon button */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--color-surface-3); color: var(--color-text-primary); }
.btn-icon--lg { width: 40px; height: 40px; border-radius: var(--radius-md); }

/* Sizes */
.btn-sm { height: 28px; font-size: var(--text-xs); padding: 0 var(--space-3); }
.btn-lg { height: 44px; font-size: var(--text-md); padding: 0 var(--space-6); border-radius: var(--radius-md); }

/* Loading state */
.btn--loading { pointer-events: none; }
.btn--loading .btn-label { opacity: 0; }
.btn--loading::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Ripple effect */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  width: 8px; height: 8px;
  background: rgba(255,255,255,0.15);
  pointer-events: none;
  transform: scale(0);
  animation: ripple 400ms ease-out forwards;
}

/* Icon sizes */
.icon-16 { width: 16px; height: 16px; flex-shrink: 0; }
.icon-20 { width: 20px; height: 20px; flex-shrink: 0; }
.icon-24 { width: 24px; height: 24px; flex-shrink: 0; }
.icon-48 { width: 48px; height: 48px; flex-shrink: 0; }

/* ===== INPUTS ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.field-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}
.field-label--required::after { content: ' *'; color: var(--color-accent-r); }

.input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--duration-base), box-shadow var(--duration-base);
  outline: none;
}
.input::placeholder { color: var(--color-text-muted); }
.input:focus {
  border-color: rgba(51,102,255,0.5);
  box-shadow: 0 0 0 3px rgba(51,102,255,0.08);
}
.input--error { border-color: rgba(255,51,102,0.5) !important; }
.input--error:focus { box-shadow: 0 0 0 3px rgba(255,51,102,0.08) !important; }

.textarea {
  width: 100%;
  padding: var(--space-3);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  resize: vertical;
  min-height: 96px;
  transition: border-color var(--duration-base), box-shadow var(--duration-base);
  outline: none;
}
.textarea::placeholder { color: var(--color-text-muted); }
.textarea:focus { border-color: rgba(51,102,255,0.5); box-shadow: 0 0 0 3px rgba(51,102,255,0.08); }

.field-error {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 12px;
  color: var(--color-danger);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--duration-base), opacity var(--duration-base);
}
.field-error--visible { max-height: 24px; opacity: 1; }

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

/* Input with icon */
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 36px; }
.input-wrap .input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}
.input-wrap .input-suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* Password strength bar */
.password-strength { margin-top: var(--space-2); }
.password-strength-bar {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}
.password-strength-seg {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--color-surface-4);
  transition: background var(--duration-base);
}
.password-strength-seg--active-1 { background: var(--color-danger); }
.password-strength-seg--active-2 { background: var(--color-warning); }
.password-strength-seg--active-3 { background: #f0c040; }
.password-strength-seg--active-4 { background: var(--color-success); }
.password-strength-label { font-size: 11px; color: var(--color-text-muted); text-align: right; }

/* Select */
.select {
  appearance: none;
  width: 100%;
  height: 40px;
  padding: 0 var(--space-8) 0 var(--space-3);
  background: var(--color-surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  outline: none;
}
.select:focus { border-color: rgba(51,102,255,0.5); box-shadow: 0 0 0 3px rgba(51,102,255,0.08); }

/* Checkbox */
.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
}
.checkbox-input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--color-accent-b);
  cursor: pointer;
}
.checkbox-label { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.5; }

/* Divider with text */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ===== CARDS ===== */
.card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast),
    border-color var(--duration-fast);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border-color: #3a3a3a;
}
.card-body { padding: var(--space-4); }

/* Project card */
.project-card {
  position: relative;
  cursor: pointer;
}
.project-card-thumb {
  width: 100%;
  height: 140px;
  position: relative;
  overflow: hidden;
}
.project-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
}
.project-card-info { padding: var(--space-3) var(--space-4); }
.project-card-name {
  font-size: 14px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--space-1);
}
.project-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.project-card-menu {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  opacity: 0;
  transition: opacity var(--duration-fast);
}
.project-card:hover .project-card-menu { opacity: 1; }
.project-card-select {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  width: 18px;
  height: 18px;
  opacity: 0;
  transition: opacity var(--duration-fast);
  cursor: pointer;
  accent-color: var(--color-accent-b);
  z-index: 2;
}
.project-card:hover .project-card-select,
.project-card--selected .project-card-select { opacity: 1; }
.project-card--selected {
  border-color: var(--color-accent-b);
  box-shadow: 0 0 0 2px rgba(51,102,255,0.25);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge--website { color: #8ab4ff; background: rgba(51,102,255,0.1); }
.badge--website .badge-dot { background: var(--color-accent-b); }
.badge--mobile  { color: #7affcc; background: rgba(51,255,153,0.1); }
.badge--mobile  .badge-dot { background: var(--color-accent-g); }
.badge--system  { color: #ff8ab4; background: rgba(255,51,102,0.1); }
.badge--system  .badge-dot { background: var(--color-accent-r); }
.badge--success { color: #7affcc; background: var(--color-success-bg); }
.badge--danger  { color: #ff8ab4; background: var(--color-danger-bg); }
.badge--warning { color: #ffd080; background: var(--color-warning-bg); }
.badge--info    { color: #8ab4ff; background: var(--color-info-bg); }
.badge--neutral { color: var(--color-text-secondary); background: var(--color-surface-3); }
.badge--pro     { background: var(--accent-gradient); color: #fff; }

/* ===== AVATARS ===== */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  flex-shrink: 0;
  background: var(--color-surface-4);
  color: var(--color-text-secondary);
  overflow: hidden;
  position: relative;
}
.avatar--sm  { width: 24px; height: 24px; font-size: 9px; }
.avatar--md  { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar--lg  { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar--xl  { width: 64px; height: 64px; font-size: var(--text-lg); }
.avatar--2xl { width: 96px; height: 96px; font-size: var(--text-2xl); }

/* Gradient ring (AI avatar) */
.avatar--ai { background: var(--accent-gradient); color: #fff; }
.avatar--ring {
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px;
  background-clip: padding-box;
}

/* Online dot */
.avatar-wrap { position: relative; display: inline-block; }
.avatar-online-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 8px; height: 8px;
  background: var(--color-accent-g);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
}

/* Stacked avatars */
.avatar-stack {
  display: flex;
}
.avatar-stack .avatar {
  border: 2px solid var(--color-bg);
  margin-left: -8px;
}
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ===== MODALS ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-backdrop.active { display: flex; animation: fade-in var(--duration-base) var(--ease-out); }

.modal {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  width: 100%;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  animation: fade-in-scale var(--duration-base) var(--ease-out);
  position: relative;
  z-index: var(--z-modal);
}
.modal--sm  { max-width: 420px; }
.modal--md  { max-width: 520px; }
.modal--lg  { max-width: 640px; }
.modal--xl  { max-width: 800px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.modal-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.modal-body { padding: var(--space-6); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
}

/* ===== DROPDOWNS ===== */
.dropdown {
  position: absolute;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  min-width: 180px;
  z-index: var(--z-dropdown);
  padding: var(--space-1) 0;
  animation: slide-down var(--duration-fast) var(--ease-out);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  height: 32px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  user-select: none;
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--color-surface-4); color: var(--color-text-primary); }
.dropdown-item--active { color: var(--color-accent-b); }
.dropdown-item--danger { color: var(--color-danger); }
.dropdown-item--danger:hover { background: var(--color-danger-bg); }
.dropdown-divider { height: 1px; background: var(--color-border); margin: var(--space-1) 0; }
.dropdown-label {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
}

/* Context menu — same styling */
.context-menu {
  position: fixed;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  min-width: 180px;
  z-index: var(--z-context-menu);
  padding: var(--space-1) 0;
  animation: slide-down var(--duration-fast) var(--ease-out);
  display: none;
}
.context-menu.active { display: block; }

/* ===== TOOLTIPS ===== */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface-4);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: var(--text-xs);
  padding: 4px var(--space-2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-md);
}
.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--color-border);
}
.tooltip-wrap:hover .tooltip { opacity: 1; }
.tooltip--right { bottom: auto; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }

/* ===== TOASTS ===== */
.toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-elevated);
  font-size: var(--text-sm);
  pointer-events: all;
  animation: slide-up var(--duration-base) var(--ease-out);
  transition: opacity var(--duration-base), transform var(--duration-base);
}
.toast--success { border-left: 3px solid var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-danger); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info    { border-left: 3px solid var(--color-info); }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon--success { color: var(--color-success); }
.toast-icon--error   { color: var(--color-danger); }
.toast-icon--warning { color: var(--color-warning); }
.toast-icon--info    { color: var(--color-info); }
.toast-body { flex: 1; }
.toast-message { color: var(--color-text-primary); line-height: var(--leading-normal); }
.toast-action { font-size: var(--text-xs); color: var(--color-accent-b); cursor: pointer; margin-top: 2px; display: inline-block; }
.toast-close {
  flex-shrink: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast);
}
.toast-close:hover { color: var(--color-text-primary); }
.toast--dismissing { opacity: 0; transform: translateX(20px); }

/* ===== TOGGLES ===== */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--color-surface-4);
  border-radius: var(--radius-full);
  transition: background var(--duration-base);
  flex-shrink: 0;
}
.toggle-input:checked ~ .toggle-track { background: var(--color-accent-b); }
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left var(--duration-base) var(--ease-out);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-input:checked ~ .toggle-track .toggle-thumb { left: 20px; }
.toggle-input:focus-visible ~ .toggle-track { box-shadow: var(--shadow-focus-b); }
.toggle-label { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* ===== TABS ===== */
.tabs {
  display: flex;
  align-items: center;
  position: relative;
}
.tabs--pill {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.tabs--underline {
  border-bottom: 1px solid var(--color-border);
  gap: 0;
}

.tab-item {
  position: relative;
  padding: 0 var(--space-3);
  height: 32px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color var(--duration-fast), background var(--duration-fast);
  user-select: none;
  white-space: nowrap;
  z-index: 1;
}
.tab-item:hover { color: var(--color-text-secondary); }
.tab-item.active { color: var(--color-text-primary); }
.tabs--pill .tab-item.active { background: var(--color-surface-3); }

/* Sliding underline indicator */
.tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: var(--color-accent-b);
  border-radius: 2px 2px 0 0;
  transition: transform var(--duration-base) var(--ease-out), width var(--duration-base) var(--ease-out);
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== SKELETONS ===== */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-surface-2) 0%,
    var(--color-surface-3) 50%,
    var(--color-surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; }
.skeleton-text--sm  { height: 11px; }
.skeleton-text--lg  { height: 18px; }
.skeleton-card { height: 200px; border-radius: var(--radius-lg); }
.skeleton-thumb { height: 140px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.skeleton-avatar { width: 32px; height: 32px; border-radius: 50%; }
.skeleton-circle { border-radius: 50%; }

/* ===== EMPTY STATES ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-4);
}
.empty-state-illustration {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: var(--space-2);
}
.empty-state-orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-gradient);
  opacity: 0.3;
  filter: blur(12px);
}
.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}
.empty-state-desc { font-size: var(--text-sm); color: var(--color-text-secondary); max-width: 320px; line-height: var(--leading-loose); }

/* ===== PROGRESS ===== */
.progress { height: 4px; background: var(--color-surface-3); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 300ms var(--ease-out);
}
.progress--indeterminate .progress-bar {
  width: 40% !important;
  position: relative;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}
.progress--lg { height: 6px; }
.progress--sm { height: 2px; }

/* ===== INLINE EDIT ===== */
.inline-edit { position: relative; display: inline-block; cursor: text; }
.inline-edit-text {
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}
.inline-edit:hover .inline-edit-text { background: var(--color-surface-3); }
.inline-edit-input {
  background: var(--color-surface-3);
  border: 1px solid rgba(51,102,255,0.5);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font: inherit;
  padding: 2px 4px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(51,102,255,0.08);
}

/* ===== STEP INDICATORS ===== */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  transition: background var(--duration-base), transform var(--duration-base);
  cursor: default;
}
.step-dot.active {
  background: var(--accent-gradient);
  transform: scale(1.3);
}
.step-dot.completed { background: var(--color-accent-g); }
.steps--spaced { gap: var(--space-2); }

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.breadcrumb-item { cursor: pointer; transition: color var(--duration-fast); }
.breadcrumb-item:hover { color: var(--color-text-primary); }
.breadcrumb-sep { color: var(--color-text-muted); opacity: 0.5; }
.breadcrumb-item:last-child { color: var(--color-text-secondary); cursor: default; }

/* ===== COMMAND PALETTE ===== */
.command-palette {
  position: fixed;
  top: 20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  max-width: calc(100vw - 32px);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  z-index: var(--z-command-palette);
  display: none;
  overflow: hidden;
}
.command-palette.active { display: block; animation: fade-in-scale var(--duration-base) var(--ease-out); }
.command-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.command-palette-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: var(--text-md);
  color: var(--color-text-primary);
  caret-color: var(--color-accent-b);
}
.command-palette-input::placeholder { color: var(--color-text-muted); }
.command-palette-results { max-height: 400px; overflow-y: auto; padding: var(--space-1) 0; }
.command-palette-group { padding: var(--space-2) var(--space-4) var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.8px; color: var(--color-text-muted); }
.command-palette-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  height: 40px;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
  color: var(--color-text-secondary);
}
.command-palette-item:hover, .command-palette-item.highlighted {
  background: var(--color-surface-3);
  color: var(--color-text-primary);
  border-left: 2px solid var(--color-accent-b);
}
.command-palette-shortcut {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface-3);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
}
.command-palette-empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ===== SOCIAL AUTH BUTTONS ===== */
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background var(--duration-base), border-color var(--duration-base);
  flex: 1;
}
.btn-social:hover { background: var(--color-surface-3); border-color: #3a3a3a; }

/* ===== CONFETTI ===== */
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: var(--z-toast);
  animation: confetti-fly var(--duration, 1.5s) ease-out forwards;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: dot-bounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
.typing-label { font-size: var(--text-xs); color: var(--color-text-muted); margin-left: var(--space-1); }

/* ===== UNSAVED CHANGES BAR ===== */
.unsaved-bar {
  position: sticky;
  bottom: 0;
  height: 52px;
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-border);
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 10;
}
.unsaved-bar.active { display: flex; animation: slide-up 200ms var(--ease-out); }
.unsaved-bar-text { font-size: var(--text-sm); color: var(--color-text-secondary); }
.unsaved-bar-actions { display: flex; gap: var(--space-2); }

/* ===== BULK ACTIONS BAR ===== */
.bulk-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--color-surface-1);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: var(--z-dropdown);
  transform: translateY(100%);
  transition: transform var(--duration-base) var(--ease-out);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.bulk-actions-bar.active { transform: translateY(0); }
.bulk-count { font-size: var(--text-sm); color: var(--color-text-secondary); }
.bulk-count strong { color: var(--color-text-primary); }

/* ===== NOTIFICATION PANEL ===== */
.notification-panel {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  width: 360px;
  height: calc(100vh - var(--topbar-h));
  background: var(--color-surface-1);
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notification-panel.active { transform: translateX(0); }
.notification-panel-header {
  height: 48px;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.notification-panel-title { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.notification-list { flex: 1; overflow-y: auto; }
.notification-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  gap: var(--space-3);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.notification-item:hover { background: var(--color-surface-2); }
.notification-item--unread { background: var(--color-surface-2); border-left: 2px solid var(--color-accent-b); }
.notification-item-icon { flex-shrink: 0; color: var(--color-text-muted); margin-top: 1px; }
.notification-item-body { flex: 1; min-width: 0; }
.notification-item-title { font-size: var(--text-sm); font-weight: var(--weight-medium); margin-bottom: 2px; }
.notification-item-desc { font-size: 12px; color: var(--color-text-secondary); line-height: 1.4; }
.notification-item-time { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }
.notification-unread-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--color-accent-r);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
}

/* ===== PROMPT LIBRARY DROPDOWN ===== */
.prompt-library-dropdown {
  position: fixed;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  max-height: 280px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  display: none;
  animation: slide-up var(--duration-fast) var(--ease-out);
}
.prompt-library-dropdown.active { display: block; }
.prompt-library-section { padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.8px; color: var(--color-text-muted); }
.prompt-library-item {
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: background var(--duration-fast), color var(--duration-fast);
  border-radius: var(--radius-sm);
  margin: 1px var(--space-1);
}
.prompt-library-item:hover, .prompt-library-item.focused { background: var(--color-surface-3); color: var(--color-text-primary); }

/* ===== MISC UTILITIES ===== */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dot-grid {
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}
.scroll-shadow-top    { box-shadow: inset 0 12px 12px -12px rgba(0,0,0,0.5); }
.scroll-shadow-bottom { box-shadow: inset 0 -12px 12px -12px rgba(0,0,0,0.5); }
.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
