/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.14); }
.btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}
.btn-danger { color: #fc8181; border-color: rgba(252,129,129,0.3); }
.btn-danger:hover { background: rgba(252,129,129,0.15); }
.btn-primary { background: var(--critical-path); border-color: var(--critical-path); }
.btn-primary:hover { background: #0055cc; }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Inputs */
.input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color var(--transition);
}
.input:focus { border-color: rgba(255,255,255,0.25); }

/* Glass panel */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Sidebar list items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.3;
  position: relative;
  transition: opacity 0.15s ease, max-height 0.18s ease;
  overflow: hidden;
  max-height: 60px;
}
.sidebar-item.filtered-out {
  opacity: 0;
  max-height: 0;
  padding: 0;
  pointer-events: none;
}

.sidebar-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.15s;
}

/* Buttons float over right side of text on hover -- no reserved space */
.item-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  background: linear-gradient(to right, transparent, var(--bg-sidebar) 30%);
  padding-left: 18px;
  border-radius: 3px;
}
.sidebar-item:hover .item-actions,
.sidebar-item:focus-within .item-actions {
  opacity: 1;
  pointer-events: auto;
}
/* Fade text slightly under the buttons on hover */
.sidebar-item:hover .sidebar-item-text { opacity: 0.7; }

.sidebar-item .edit-btn {
  font-size: 10px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar-item:hover .edit-btn { opacity: 1; }

.item-btn {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-main);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  line-height: 1.4;
  transition: all 0.1s;
}
.item-btn:hover { background: rgba(255,255,255,0.14); color: var(--text); }
.item-btn.danger { color: #fc8181; }
.item-btn.danger:hover { background: rgba(197,48,48,0.2); color: #fc8181; }

/* Status pill */
.status-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Toggle switch */
.toggle-label {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text);
}
.toggle-label input { cursor: pointer; }

/* Mode bar elements */
.mode-label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mode-hint {
  flex: 1;
  font-size: 11px;
  opacity: 0.7;
  text-align: center;
}

.mode-name-input {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 3px 8px;
  font-size: 12px;
  width: 160px;
}
.mode-name-input:focus { outline: none; border-color: #63b3ed; box-shadow: 0 0 0 2px rgba(99,179,237,0.3); }
.mode-name-input::selection { background: #2b6cb0; color: #fff; }

/* Tooltip */
.node-tooltip {
  position: fixed;
  background: rgba(13,27,42,0.97);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text);
  pointer-events: none !important;
  user-select: none;
  z-index: 500;
  min-width: 240px;
  max-width: 320px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.tt-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.tt-id { color: var(--text-muted); font-size: 10px; font-family: var(--font-mono); }
.tt-name { font-weight: 700; font-size: 13px; flex: 1; }
.tt-status-pill { font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 8px; color: #fff; text-transform: uppercase; flex-shrink: 0; }
.tt-desc { color: var(--text-muted); font-size: 10px; margin-bottom: 8px; line-height: 1.4; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.tt-section { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 6px 0 4px; }
.tt-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-bottom: 6px; }
.tt-stat { background: rgba(255,255,255,0.04); border-radius: 4px; padding: 4px 6px; text-align: center; }
.tt-stat-val { font-size: 14px; font-weight: 700; line-height: 1; }
.tt-stat-lbl { font-size: 9px; color: var(--text-muted); margin-top: 1px; }
.tt-hours-row { display: flex; gap: 6px; margin-bottom: 6px; }
.tt-hours-chip { flex: 1; background: rgba(255,255,255,0.04); border-radius: 4px; padding: 3px 6px; text-align: center; }
.tt-hours-chip .v { font-size: 12px; font-weight: 700; }
.tt-hours-chip .l { font-size: 9px; color: var(--text-muted); }
.tt-people { font-size: 10px; color: var(--text-muted); }

/* Vision edit area in sidebar */
#vision-edit-area {
  flex-shrink: 0;
  padding: 6px 14px;
  display: none;
}
#vision-edit-area.active { display: block; }

#vision-add-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 4px 8px;
  font-size: 11px;
}

.create-hint {
  font-size: 11px;
  color: #94a3b8;
  padding: 6px 4px;
  font-style: italic;
  opacity: 0.7;
}

/* Vision selected item */
.vision-selected {
  border-left: 2px solid var(--vision);
  padding-left: 6px;
  background: rgba(246,224,94,0.06);
  border-radius: 3px;
}

.vision-selected-node circle:first-of-type {
  stroke: #ffffff;
  stroke-width: 3;
}

/* FIX #203: Focus-visible outline for action buttons (keyboard accessibility) */
.item-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 1px;
}

/* FIX #157: Resize handle -- larger hit target for touch devices */
.resize-handle {
  height: 12px;
  cursor: row-resize;
  background: transparent;
  flex-shrink: 0;
  transition: background var(--transition);
  touch-action: none;
}
.resize-handle:hover { background: rgba(255,255,255,0.12); }

/* Wizard banners */
.wizard-banner {
  position: fixed;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  background: rgba(74,82,148,0.97);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  pointer-events: auto;
  white-space: nowrap;
}

.wizard-banner-label {
  font-weight: 600;
}

.wizard-banner-hint {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
}

/* Task panel item layout */
.sidebar-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  position: relative;
}

.sidebar-item-id {
  font-size: 10px;
  color: #94a3b8;
  flex-shrink: 0;
}

.sidebar-item-meta {
  font-size: 10px;
  color: #94a3b8;
  flex-shrink: 0;
}

/* Kanban card delete button */
.kanban-card-del {
  background: none;
  border: none;
  color: rgba(255,255,255,0.25);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.kanban-card-del:hover {
  color: #fc8181;
}

/* Pending task banner */
.pending-task-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(45,106,79,0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* User auth dropdown */
.user-dropdown { padding: 8px 0; }
.user-dropdown-name { font-size: 12px; font-weight: 600; color: var(--text); padding: 4px 14px; }
.user-dropdown-email { font-size: 11px; color: var(--text-muted); padding: 2px 14px 6px; }
.user-dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.user-dropdown-signout { margin: 6px 14px 2px; width: calc(100% - 28px); }
